This commit is contained in:
les
2019-08-25 14:34:26 +02:00
parent 0de68b5054
commit 0eb41a1e12
13 changed files with 48 additions and 105 deletions

View File

@@ -14,7 +14,7 @@ const settingsController = require('./controller/settings')
const storage = require('./storage')
const upload = multer({ storage })
const api = express()
const api = express.Router()
api.use(cookieParser())
api.use(bodyParser.urlencoded({ extended: false }))
api.use(bodyParser.json())
@@ -100,15 +100,5 @@ api.get('/export/:type', exportController.export)
// get events in this range
api.get('/event/:month/:year', eventController.getAll)
// Handle 404
api.use(function(req, res) {
res.status(404).send('404: Page not Found')
})
// Handle 500
api.use(function(error, req, res, next) {
res.status(500).send('500: Internal Server Error')
})
module.exports = api