diff --git a/backend/package.json b/backend/package.json index 22020f6..3c28f69 100644 --- a/backend/package.json +++ b/backend/package.json @@ -23,6 +23,7 @@ "@types/luxon": "^3.0.0", "@types/node": "^18.7.6", "@types/pg": "^8.6.4", + "@types/cookie-parser": "^1.4.2", "@typescript-eslint/eslint-plugin": "^5.12.1", "@typescript-eslint/parser": "^5.12.1", "dotenv": "^16.0.3", @@ -35,6 +36,7 @@ "axios": "^1.1.3", "bcrypt": "^5.0.1", "body-parser": "^1.19.2", + "cookie-parser": "^1.4.6", "compression": "^1.7.4", "cors": "^2.8.5", "esbuild": "^0.17.6", diff --git a/backend/src/api/api.www.ts b/backend/src/api/api.www.ts index 58bc32c..340f9fd 100644 --- a/backend/src/api/api.www.ts +++ b/backend/src/api/api.www.ts @@ -4,8 +4,10 @@ import supervend from "./supervend/supervend" import astroview from "./astroview/astroview" import lcs from "./lcs/lcs" import prompt_artistry from "./prompt-artistry/prompt-artistry" +import cookieParser from "cookie-parser" const apiRouter = express.Router() +apiRouter.use(cookieParser()) const apis: API[] = [supervend, astroview, lcs, prompt_artistry] for (const api of apis) { @@ -18,4 +20,11 @@ apiRouter.get("/", (_req, res): void => { }) }) +apiRouter.get("/ctf", (_req, res): void => { + console.log(_req.cookies) + res.json({ + a:1 + }) +}) + export { apiRouter }