Applicatie afmaken en GUI-flow herstellen
Voegt boodschappenlijsten, productbeheer, realtime synchronisatie en browsercache-updates toe. Herstelt login- en sessiegedrag en maakt database-seeding herhaalbaar.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+26
-1
@@ -57,9 +57,29 @@ module.exports = () => {
|
||||
|
||||
app.use(session);
|
||||
|
||||
app.use(flash());
|
||||
|
||||
app.use(userMiddleware);
|
||||
|
||||
app.use(flash());
|
||||
app.use((req, res, next) => {
|
||||
res.set("X-PantryHub-Worktree", __dirname);
|
||||
res.locals.user = req.user || null;
|
||||
res.locals.success = req.flash("success");
|
||||
res.locals.error = req.flash("error");
|
||||
res.locals.info = req.flash("info");
|
||||
res.locals.warning = req.flash("warning");
|
||||
res.locals.title = "PantryHub";
|
||||
next();
|
||||
});
|
||||
|
||||
app.get("/__version", (req, res) => {
|
||||
res.set("Cache-Control", "no-store");
|
||||
res.json({
|
||||
app: "PantryHub",
|
||||
root: path.join(__dirname, ".."),
|
||||
pid: process.pid
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
app.use(
|
||||
@@ -69,6 +89,11 @@ app.use(flash());
|
||||
);
|
||||
|
||||
|
||||
app.use(
|
||||
"/api",
|
||||
require("../routes/api")
|
||||
);
|
||||
|
||||
app.use(
|
||||
"/",
|
||||
require("../routes/auth")
|
||||
|
||||
Reference in New Issue
Block a user