mfrancis95 / sbbs-web

0 stars 0 forks source link

Use view-serve to serve .ejs files #14

Closed mfrancis95 closed 8 years ago

mfrancis95 commented 8 years ago

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.

  1. Download the view-serve.js file from this repository and place it into the root of the project.
  2. Change the content of server.js to this.
  3. 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.
  4. 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.

mfrancis95 commented 8 years ago

I see that there were some slideshow changes made recently. Make sure to put those changes into locals.json.