Skip to content

Commit a1ee4e1

Browse files
authored
Forms & Data Handling: Include explicit setting of views path (#30004)
1 parent 4298f17 commit a1ee4e1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

nodeJS/express/forms_and_data_handling.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,10 @@ Create folders for `routes`, `views`, `controllers`, `storages`, and an `app.js`
210210
// app.js
211211
const express = require("express");
212212
const app = express();
213+
const path = require("node:path");
213214
const usersRouter = require("./routes/usersRouter");
214215

216+
app.set("views", path.join(__dirname, "views"));
215217
app.set("view engine", "ejs");
216218
app.use(express.urlencoded({ extended: true }));
217219
app.use("/", usersRouter);

0 commit comments

Comments
 (0)