implement user authentication with login functionality and database integration

This commit is contained in:
2025-08-18 21:47:20 +02:00
parent 817a1efcdd
commit 298bc81435
12 changed files with 384 additions and 38 deletions

View File

@@ -11,6 +11,11 @@ app.use(express.urlencoded({ extended: true, limit: "10mb" }));
app.set("view engine", "ejs");
app.use(express.json({ limit: "10mb" }));
// Import API router
import apiRouter from "./routes/api.js";
app.use("/api", apiRouter);
app.get("/", (req, res) => {
res.render("index.ejs");
});
@@ -24,4 +29,4 @@ 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!");
});
});