Updated login
This commit is contained in:
4
index.js
4
index.js
@@ -4,9 +4,11 @@ import express from "express";
|
||||
import expressWs from "express-ws";
|
||||
import morgan from "morgan";
|
||||
import cookieParser from "cookie-parser";
|
||||
import cors from "cors";
|
||||
import { initWebsocket } from "./src/websocket.js";
|
||||
import { initAuth } from "./src/auth.js";
|
||||
import { close as closeDbConnection, initDbConnection, db } from "./src/db.js";
|
||||
import { initUsers } from "./src/user.js";
|
||||
const app = express();
|
||||
const appWs = expressWs(app);
|
||||
const port = 12345;
|
||||
@@ -17,6 +19,7 @@ process.on('exit', function() {
|
||||
closeDbConnection();
|
||||
});
|
||||
|
||||
app.use(cors({credentials: true, origin: process.env.JEOPARDY_URL}));
|
||||
app.use(morgan(process.env.production ? 'common' : 'dev'));
|
||||
app.use(express.json());
|
||||
app.use(cookieParser());
|
||||
@@ -24,6 +27,7 @@ app.use(cookieParser());
|
||||
await initDbConnection();
|
||||
|
||||
initAuth(app, db);
|
||||
initUsers(app);
|
||||
initWebsocket(app);
|
||||
|
||||
app.listen(port, () => {
|
||||
|
||||
Reference in New Issue
Block a user