EJS Routing Framework

A simple EJS template for use in web development projects

To run

npm run dev
npm run watch-css

A server should be opened up at http://localhost:8080. The port may be modified using the PORT variable in the server.js file.

Outline of files

  • routes.js — This file is used for routing the different views of the frontend dynamically
  • server.js — This file is used to setup the environment and serve the responses contained in routes.js
  • routes.js — Holds the dynamic route to serve the dynamic views generated by views/root.ejs. It does this by taking the route along with the query parameters and inputting it into views/root.ejs for processing
  • root.ejs — Holds the logic that serves routes dynamically from views/pages using the data inputted:
    • route — The route
    • params — The query parameters which may be accessed using params.get(<parameter>)