view-serve will automatically serve the .ejs files inside the /views/pages directory, meaning you no longer have to write out the routes for each one in the server.js file.
Download the view-serve.js file from this repository and place it into the root of the project.
Add a new file called locals.json, also in the root directory, with this content. This is where the models that contain the titles and slides for each page will go.
Lastly, move the construction and 404 .ejs files into a new folder under /views called /special.
Note: the construction and 404 files have to be moved out of /pages because they're special cases. If they were left in, you'd be able to get to them by typing /construction or /404 in the browser.
view-serve will automatically serve the .ejs files inside the /views/pages directory, meaning you no longer have to write out the routes for each one in the
server.js
file.view-serve.js
file from this repository and place it into the root of the project.server.js
to this.locals.json
, also in the root directory, with this content. This is where the models that contain the titles and slides for each page will go./views
called/special
.Note: the construction and 404 files have to be moved out of
/pages
because they're special cases. If they were left in, you'd be able to get to them by typing /construction or /404 in the browser.