|
@@ -6,6 +6,8 @@ import express, { Express } from "express";
|
|
|
import session from "cookie-session";
|
|
|
|
|
|
import sirv from "sirv";
|
|
|
+import { createConnection, getConnectionOptions } from "typeorm";
|
|
|
+import { DB_ENTITIES } from "@shared/db/entities";
|
|
|
import { logger } from "./utils/logging";
|
|
|
|
|
|
const PORT = process.env.PORT;
|
|
@@ -23,6 +25,11 @@ if (!key) {
|
|
|
}
|
|
|
|
|
|
const createSapperServer = async (): Promise<Express> => {
|
|
|
+ await createConnection({
|
|
|
+ ...await getConnectionOptions(),
|
|
|
+ entities: DB_ENTITIES,
|
|
|
+ });
|
|
|
+
|
|
|
const app = express();
|
|
|
|
|
|
app.use(
|