Skip to content

Commit

Permalink
chore: upgrade to express 5 (#4611)
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbo committed Nov 15, 2024
1 parent deedf28 commit f0670ec
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 27 deletions.
1 change: 0 additions & 1 deletion api/middlewares/parse-form.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { urlencoded } = require('express');

const parseForm = urlencoded({
extended: false,
limit: '1kb',
});

Expand Down
2 changes: 1 addition & 1 deletion api/routers/build-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const BuildLogController = require('../controllers/build-log');
const { sessionAuth } = require('../middlewares');

router.get(
'/build/:build_id/log(/offset/:offset)?',
'/build/:build_id/log{/offset/:offset}',
sessionAuth,
BuildLogController.find,
);
Expand Down
2 changes: 1 addition & 1 deletion api/routers/build-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ router.post(
router.put('/tasks/:build_task_id/:token', BuildTaskController.update);
router.get('/tasks/types', sessionAuth, BuildTaskTypeController.list);
router.get('/tasks/default-rules', sessionAuth, BuildTaskTypeController.getDefaultRules);
router.get('/tasks/:task_id/report/:sub_page?', sessionAuth, BuildTaskController.report);
router.get('/tasks/:task_id/report/{:sub_page}', sessionAuth, BuildTaskController.report);

module.exports = router;
6 changes: 3 additions & 3 deletions api/routers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ router.get('/', MainController.home);
router.get('/system-use', MainController.systemUse);

// add csrf middleware to app route so that we can use request.csrfToken()
router.get('/organizations(/*)?', csrfProtection, MainController.app);
router.get('/sites(/*)?', csrfProtection, MainController.app);
router.get('/organizations{/*splat}', csrfProtection, MainController.app);
router.get('/sites{/*splat}', csrfProtection, MainController.app);
router.get('/settings', csrfProtection, MainController.app);

router.get('/robots.txt', MainController.robots);

router.options('(/*)?', (_req, res) => res.notFound());
router.options('{/*splat}', (_req, res) => res.notFound());

module.exports = router;
2 changes: 1 addition & 1 deletion api/routers/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ const MainController = require('../controllers/main');
const { csrfProtection } = require('../middlewares');

// add csrf middleware to app route so that we can use request.csrfToken()
router.get('/report(/*)?', csrfProtection, MainController.report);
router.get('/report{*splat}', csrfProtection, MainController.report);

module.exports = router;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"db-migrate-pg": "^1.5.2",
"deep-extend": "^0.6",
"eslint-plugin-react-hooks": "^4.6.0",
"express": "^4.19.2",
"express": "^5.0.1",
"express-rate-limit": "^5.2.3",
"express-session": "^1.18.0",
"express-slow-down": "^1.4.0",
Expand Down
Loading

0 comments on commit f0670ec

Please sign in to comment.