From d928eab3ecefbf778f1cadece9beac010dc42332 Mon Sep 17 00:00:00 2001 From: maksJopek <72977266+maksJopek@users.noreply.github.com> Date: Mon, 5 Apr 2021 00:30:46 +0200 Subject: Small step in good direction --- backend/ts/index.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'backend/ts/index.ts') diff --git a/backend/ts/index.ts b/backend/ts/index.ts index fd8f8e1..ead29f2 100644 --- a/backend/ts/index.ts +++ b/backend/ts/index.ts @@ -7,15 +7,18 @@ dotenv.config(); const app = express(); const PORT = 8000; -if (!process.env.SESSION_KEY) - throw Error("SESSION_KEY is undefined"); +if (!process.env.SESSION_KEY) process.env.SESSION_KEY = "ouh2981w1pjd9"; +// throw Error("SESSION_KEY is undefined"); -app.use(session({ secret: process.env.SESSION_KEY, cookie: { maxAge: 60000 } })) +app.use( + session({ secret: process.env.SESSION_KEY, cookie: { maxAge: 60000 } }) +); app.use("/", express.static("./public")); -app.get("/favicon.ico", (req, res) => res.redirect("https://lukesmith.xyz/favicon.ico")); -app.get("/blank", (req, res) => res.send("")); -app.post("/login", (req, res, next) => login(req, res)); +app.get("/favicon.ico", (req, res) => + res.redirect("https://lukesmith.xyz/favicon.ico") +); +app.post("/login", (req, res) => login(req, res)); app.listen(PORT, () => { console.log(`[server]: Server is running at https://localhost:${PORT}`); -- cgit v1.3.1