initial commit

This commit is contained in:
2025-08-12 11:46:50 +02:00
commit 96eebbf5ea
22 changed files with 4739 additions and 0 deletions

27
backend/server.js Normal file
View File

@@ -0,0 +1,27 @@
//statics
import express from "express";
import cors from "cors";
const app = express();
const port = 5002; // CHANGE PORT LATER
import cookieParser from "cookie-parser";
import router from "./routes/api.js";
//view engine ejs
app.set("view engine", "ejs");
app.use(express.json());
app.use(cors());
app.use(cookieParser());
app.use("/api", router);
app.listen(port, () => {
console.log(`Express backend server is running at http://localhost:${port}`);
});
// error handling code
app.use((err, req, res, next) => {
// Log the error stack and send a generic error response
console.error(err.stack);
res.status(500).send("Something broke!");
});