EJS / PUG
Last updated
Was this helpful?
Last updated
Was this helpful?
EJS is a simple templating language that lets you generate HTML markup with plain JavaScript.
add this code below const app or index
By default, Express will look inside of a views folder when resolving the template files, which is why we had to create a views folder.
Now, inside views
folder create a file called index.ejs
.
And the following into index.ejs
:
First, copy the following into app.js or index.js
:
If you run node app.js or index.js
on the terminal from the root folder, then visit http://localhost:5000/
, you should see the following results: