Skip to content

DWDatITP/sample-templates-ejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Templating

This sample app demonstrates the use of ejs templates.

Installation

  • git clone https://github.com/DWDatITP/sample-templates-ejs.git
  • cd sample-templates-ejs
  • npm install
  • nodemon server.js
  • open http://localhost:5000

Adding EJS to your existing app

  • This will download the ejs module and update your package.json to list it (important for when you deploy to Heroku):
  • npm install --save ejs
  • Then, update your server.js file to set the app's view engine to ejs:
  • app.set('view engine', 'ejs'); # Here it is in the server.js code.
  • Next, create a folder called "views"
  • Now, in your app's handler you can call res.render('viewName'). The app will look up a file called 'viewName.ejs' in your views folder and render it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published