|
|
@ -1,6 +1,7 @@
|
|
|
|
import * as compression from "compression";
|
|
|
|
import * as compression from "compression";
|
|
|
|
import connectPgSimple = require("connect-pg-simple");
|
|
|
|
import connectPgSimple = require("connect-pg-simple");
|
|
|
|
import * as cookieParser from "cookie-parser";
|
|
|
|
import * as cookieParser from "cookie-parser";
|
|
|
|
|
|
|
|
import * as cors from "cors";
|
|
|
|
import * as express from "express";
|
|
|
|
import * as express from "express";
|
|
|
|
import * as graphqlHTTP from "express-graphql";
|
|
|
|
import * as graphqlHTTP from "express-graphql";
|
|
|
|
import * as session from "express-session";
|
|
|
|
import * as session from "express-session";
|
|
|
@ -63,6 +64,9 @@ class App {
|
|
|
|
this.app.use(express.static(path.join(__dirname, "public")));
|
|
|
|
this.app.use(express.static(path.join(__dirname, "public")));
|
|
|
|
this.app.use(cookieParser());
|
|
|
|
this.app.use(cookieParser());
|
|
|
|
this.app.use(appSession);
|
|
|
|
this.app.use(appSession);
|
|
|
|
|
|
|
|
if (globals.config.server.cors) {
|
|
|
|
|
|
|
|
this.app.use(cors());
|
|
|
|
|
|
|
|
}
|
|
|
|
this.app.use((req, res, next) => {
|
|
|
|
this.app.use((req, res, next) => {
|
|
|
|
logger.verbose(`${req.method} ${req.url}`);
|
|
|
|
logger.verbose(`${req.method} ${req.url}`);
|
|
|
|
next();
|
|
|
|
next();
|
|
|
|