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 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({