Import (not require)

This commit is contained in:
Tom Russell 2018-09-13 19:54:16 +01:00
parent 0449170b76
commit cf7128c66f

View File

@ -5,9 +5,9 @@ import { renderToString } from 'react-dom/server';
import serialize from 'serialize-javascript'; import serialize from 'serialize-javascript';
import pathToRegexp from 'path-to-regexp'; import pathToRegexp from 'path-to-regexp';
const bodyParser = require('body-parser') import bodyParser from 'body-parser';
const session = require('express-session') import session from 'express-session';
const pgSession = require('connect-pg-simple')(session); import pgConnect from 'connect-pg-simple';
import App from './frontend/app'; import App from './frontend/app';
import { pool } from './db'; import { pool } from './db';
@ -31,6 +31,7 @@ server.use(express.static(process.env.RAZZLE_PUBLIC_DIR));
server.use(bodyParser.json()); server.use(bodyParser.json());
// handle user sessions // handle user sessions
const pgSession = pgConnect(session);
const sess = { const sess = {
name: 'cl.session', name: 'cl.session',
store: new pgSession({ store: new pgSession({