Merge laatste worktree in master
Neemt de laatste PantryHub-implementatie over in de hoofdbranch.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+19
-16
@@ -57,24 +57,29 @@ module.exports = () => {
|
||||
|
||||
app.use(session);
|
||||
|
||||
app.use(flash());
|
||||
app.use(flash());
|
||||
|
||||
app.use(userMiddleware);
|
||||
app.use(userMiddleware);
|
||||
|
||||
app.use((req, res, next) => {
|
||||
|
||||
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 = res.locals.title || "PantryHub";
|
||||
|
||||
next();
|
||||
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(
|
||||
@@ -84,13 +89,11 @@ module.exports = () => {
|
||||
);
|
||||
|
||||
|
||||
// API Routes
|
||||
app.use(
|
||||
"/api",
|
||||
require("../routes/api")
|
||||
);
|
||||
|
||||
// Web Routes
|
||||
app.use(
|
||||
"/",
|
||||
require("../routes/auth")
|
||||
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
const session = require("express-session");
|
||||
const BetterSqlite3Store = require("better-sqlite3-session-store")(session);
|
||||
const Database = require("better-sqlite3");
|
||||
const path = require("path");
|
||||
|
||||
const db = new Database("sessions.sqlite");
|
||||
const db = new Database(path.join(__dirname, "..", "sessions.sqlite"));
|
||||
|
||||
module.exports = session({
|
||||
|
||||
|
||||
Reference in New Issue
Block a user