|
@@ -8,15 +8,16 @@ import session from "cookie-session";
|
|
|
import sirv from "sirv";
|
|
|
import { createConnection, getConnectionOptions } from "typeorm";
|
|
|
import { DB_ENTITIES } from "@shared/db/entities";
|
|
|
-import { eventLogger, logger } from "./utils/logging";
|
|
|
+import { logger } from "./utils/logging";
|
|
|
import { AppSession } from "./utils/session";
|
|
|
|
|
|
const PORT = process.env.PORT; // eslint-disable-line prefer-destructuring
|
|
|
// @ts-ignore -- creates a warning after `rollup-plugin-replace` (set up in `rollup.config.js`)
|
|
|
// replaces `process.env.NODE_ENV` with `"production"` during `prod`
|
|
|
const dev = process.env.NODE_ENV === "development";
|
|
|
+const secure = process.env.SECURE === "TRUE";
|
|
|
|
|
|
-logger.info("Staring webserver to port %s", PORT);
|
|
|
+logger.info("Staring webserver to port %s (is dev: %s)", PORT, dev);
|
|
|
|
|
|
const key = process.env.WEB_COOKIE_KEY;
|
|
|
|
|
@@ -39,7 +40,7 @@ const createSapperServer = async (): Promise<Express> => {
|
|
|
session({
|
|
|
secret: key,
|
|
|
name: "session",
|
|
|
- secure: !dev,
|
|
|
+ secure,
|
|
|
}),
|
|
|
compression({ threshold: 0 }),
|
|
|
sirv("static", { dev }),
|