0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Return a basic error message when DB connection is lost

This commit is contained in:
G.Ambatte
2025-07-26 12:13:59 +12:00
parent 63d957fdc6
commit 7af22c9da7
3 changed files with 78 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ import { splitTextStyleAndMetadata } from '../shared/helpers.js';
//==== Middleware Imports ====//
import contentNegotiation from './middleware/content-negotiation.js';
import dbCheck from './middleware/dbCheck.js';
import bodyParser from 'body-parser';
import cookieParser from 'cookie-parser';
import forceSSL from './forcessl.mw.js';
@@ -49,6 +50,7 @@ const sanitizeBrew = (brew, accessType)=>{
app.set('trust proxy', 1 /* number of proxies between user and server */);
app.use('/', serveCompressedStaticAssets(`build`));
app.use(dbCheck);
app.use(contentNegotiation);
app.use(bodyParser.json({ limit: '25mb' }));
app.use(cookieParser());