arma-server-web-admin/routes/mods.js

27 lines
535 B
JavaScript
Raw Normal View History

var express = require('express')
2017-04-01 09:19:30 +00:00
module.exports = function (modsManager) {
var router = express.Router()
2017-04-01 09:19:30 +00:00
router.get('/', function (req, res) {
res.send(modsManager.mods)
})
2017-04-01 09:19:30 +00:00
router.delete('/:mod', function (req, res) {
modsManager.delete(req.params.mod, function (err) {
if (err) {
res.status(500).send(err)
2017-04-01 09:19:30 +00:00
} else {
res.status(204).send()
2017-04-01 09:19:30 +00:00
}
})
})
2017-04-01 09:19:30 +00:00
router.post('/refresh', function (req, res) {
modsManager.updateMods()
res.status(204).send()
})
2017-04-01 09:19:30 +00:00
return router
}