implement user authentication with login functionality and database integration
This commit is contained in:
@@ -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!");
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user