diff --git a/.github/workflows/full-stack-tests.yml b/.github/workflows/full-stack-tests.yml index fbd1e96..0789dc0 100644 --- a/.github/workflows/full-stack-tests.yml +++ b/.github/workflows/full-stack-tests.yml @@ -55,7 +55,7 @@ jobs: cd frontend npm install - - name: Build Frontend (if necessary) + - name: Build Frontend run: | cd frontend npm run build diff --git a/backend/src/index.ts b/backend/src/index.ts index 01d7d19..849a250 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -5,12 +5,31 @@ import linkRoutes from "./routes/linkRoutes"; const app = new App([userRoutes, statusRoutes, linkRoutes]); -app - .initializeDB() - .then(() => { - app.listen(); - }) - .catch((error) => { - console.error("Failed to initialize the application:", error); - process.exit(1); +app.get("/corstest", (req: Request, res: Response) => { + res.json({ + status: "ok", }); +}); + +app.use( + session({ + secret: PASSPORT_SECRET, + resave: false, + saveUninitialized: false, + }) +); +const passportMiddleware = initializePassport(); +app.use(passportMiddleware.initialize()); + +passport.use(new LocalStrategy(UserModel.authenticate())); +passport.serializeUser(UserModel.serializeUser()); +passport.deserializeUser(UserModel.deserializeUser()); + +app.use("/", userRoutes); +app.use("/", statusRoutes); +app.use("/", linkRoutes); + +//Express-Server +app.listen(PORT, () => { + console.log(`Server is running on port ${PORT}`); +});