summaryrefslogtreecommitdiffstats
path: root/backend/src/index.js
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@eficode.com>2020-02-05 19:50:40 +0200
committerJan Tuomi <jan.tuomi@eficode.com>2020-02-05 19:50:40 +0200
commitf9b88d03e322734b3e81e2df6e1dd2d13c919d6b (patch)
treeed22518b1565717cfc710f00307a17898c2e3849 /backend/src/index.js
parent71d9490d0988c97b8b023a70e0b61c65f32ad3b9 (diff)
Implement password strength requirements
Diffstat (limited to 'backend/src/index.js')
-rw-r--r--backend/src/index.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/backend/src/index.js b/backend/src/index.js
index 128ed60..6b196f3 100644
--- a/backend/src/index.js
+++ b/backend/src/index.js
@@ -6,6 +6,17 @@ const routes = require('./routes');
const app = express();
+app.use((_, res, next) => {
+ try {
+ next();
+ } catch (err) {
+ console.error(err);
+ res.status(500);
+ res.json({
+ error: 'Internal server error',
+ });
+ }
+});
app.use(morgan('dev'));
app.use(bodyParser.json());
app.use(cookieParser());