1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 16:19:26 +00:00

Lint cleanup with new rules

This commit is contained in:
2022-03-03 09:14:09 +00:00
parent 80291efc6d
commit c9e826d016
20 changed files with 104 additions and 57 deletions

18
app.js
View File

@@ -45,7 +45,7 @@ async function main() {
// Set up express-session to store in mysql database
const mysqlStore = require('express-mysql-session')(session);
const sessionStore =
new mysqlStore({},(await new DatabaseConnectionPool()).pool);
new mysqlStore({}, (await new DatabaseConnectionPool()).pool);
// Initialise express app
const app = express();
@@ -82,9 +82,11 @@ async function main() {
}
}));
// Authentication middleware that redirects unauthenticated users
// back to the login page if they request a page they don't have access
// to
/*
* Authentication middleware that redirects unauthenticated users
* back to the login page if they request a page they don't have access
* to
*/
app.use((req, res, next) => {
const allowed = [
'/login',
@@ -116,9 +118,11 @@ async function main() {
for (const route of loadRoutes())
app.use(route[0], route[1]);
// If the request gets to the bottom of the route stack, it doesn't
// have a defined route and therefore a HTTP status code 404 is sent
// and an error page shown
/*
* If the request gets to the bottom of the route stack, it doesn't
* have a defined route and therefore a HTTP status code 404 is sent
* and an error page shown
*/
app.use((req, res) => {
res.status(404).render('error', {
title: 'Stratos - Error',