Skip to content

Commit

Permalink
Move middleware into lib folder (#440)
Browse files Browse the repository at this point in the history
This moves the `middleware` folder into the `lib` folder and updates
file references to them.

This is to enable easier updates to the kit, as the instructions could
be simplified to downloading the new version and replacing the `lib`
folder, plus a few manual changes to files outside `lib` (which we can
hopefully further reduce).

Part of #393.
  • Loading branch information
frankieroberto authored Dec 13, 2024
1 parent c19e71c commit c3fe03f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ dotenv.config();

// Local dependencies
const packageInfo = require('./package.json');
const authentication = require('./middleware/authentication');
const automaticRouting = require('./middleware/auto-routing');
const authentication = require('./lib/middleware/authentication');
const automaticRouting = require('./lib/middleware/auto-routing');
const config = require('./app/config');
const locals = require('./app/locals');
const routes = require('./app/routes');
const utils = require('./lib/utils');

const prototypeAdminRoutes = require('./middleware/prototype-admin-routes');
const prototypeAdminRoutes = require('./lib/middleware/prototype-admin-routes');
const exampleTemplatesRoutes = require('./lib/example_templates_routes');

// Set configuration variables
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const url = require('url');
const { encryptPassword } = require('../lib/utils');
const { encryptPassword } = require('../utils');

const allowedPathsWhenUnauthenticated = [
'/prototype-admin/password',
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const router = express.Router();

const password = process.env.PROTOTYPE_PASSWORD;

const { encryptPassword } = require('../lib/utils');
const { encryptPassword } = require('../utils');

router.get('/password', (req, res) => {
const returnURL = req.query.returnURL || '/';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test:ci": "jest --ci",
"prewatch": "gulp build",
"watch": "gulp",
"lint:js": "eslint -c ./linters/.eslintrc.js app.js middleware/**/*.js lib/**/*.js app/*.js"
"lint:js": "eslint -c ./linters/.eslintrc.js app.js lib/**/*.js app/*.js"
},
"author": "https://github.com/nhsuk/",
"license": "MIT",
Expand Down

0 comments on commit c3fe03f

Please sign in to comment.