From a273c86506a4542258752cedc33364c48967b664 Mon Sep 17 00:00:00 2001 From: Ace Da Costa Date: Thu, 24 Oct 2024 13:03:25 +0000 Subject: [PATCH 1/2] Use path to help locate views/ --- nodeJS/authentication/authentication_basics.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodeJS/authentication/authentication_basics.md b/nodeJS/authentication/authentication_basics.md index 80a860dc10e..aa5fcdd2997 100644 --- a/nodeJS/authentication/authentication_basics.md +++ b/nodeJS/authentication/authentication_basics.md @@ -49,6 +49,7 @@ For the moment we are saving our users with just a plain text password. This is ```javascript /////// app.js +const path = require("path"); const { Pool } = require("pg"); const express = require("express"); const session = require("express-session"); @@ -60,7 +61,7 @@ const pool = new Pool({ }); const app = express(); -app.set("views", __dirname); +app.set("views", path.join(__dirname, "views")); app.set("view engine", "ejs"); app.use(session({ secret: "cats", resave: false, saveUninitialized: false })); From 7149da3cf1c39e9247028bd6ecd1e2e3cd851235 Mon Sep 17 00:00:00 2001 From: Ace Da Costa Date: Thu, 31 Oct 2024 15:29:36 +0000 Subject: [PATCH 2/2] Update nodeJS/authentication/authentication_basics.md Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com> --- nodeJS/authentication/authentication_basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeJS/authentication/authentication_basics.md b/nodeJS/authentication/authentication_basics.md index aa5fcdd2997..8e7280e6743 100644 --- a/nodeJS/authentication/authentication_basics.md +++ b/nodeJS/authentication/authentication_basics.md @@ -49,7 +49,7 @@ For the moment we are saving our users with just a plain text password. This is ```javascript /////// app.js -const path = require("path"); +const path = require("node:path"); const { Pool } = require("pg"); const express = require("express"); const session = require("express-session");