From cf7128c66f6a13da94e849060f00848f14996c81 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 13 Sep 2018 19:54:16 +0100 Subject: [PATCH] Import (not require) --- app/src/server.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/server.js b/app/src/server.js index bfe785b3..ee439e33 100644 --- a/app/src/server.js +++ b/app/src/server.js @@ -5,9 +5,9 @@ import { renderToString } from 'react-dom/server'; import serialize from 'serialize-javascript'; import pathToRegexp from 'path-to-regexp'; -const bodyParser = require('body-parser') -const session = require('express-session') -const pgSession = require('connect-pg-simple')(session); +import bodyParser from 'body-parser'; +import session from 'express-session'; +import pgConnect from 'connect-pg-simple'; import App from './frontend/app'; import { pool } from './db'; @@ -31,6 +31,7 @@ server.use(express.static(process.env.RAZZLE_PUBLIC_DIR)); server.use(bodyParser.json()); // handle user sessions +const pgSession = pgConnect(session); const sess = { name: 'cl.session', store: new pgSession({