Jul 4, 2024
npm install
in the root directory to install dependencies in package.json
.app.js
file.app.js
/
).public
folder.localhost:3000
to trigger root GET request).views
folder with a index.js
file for HTML templates.createHomepageTemplate
returning HTML as template string.inline HTML
extension for syntax highlighting and Emmet features./* HTML */
before template string for extension to work.createHomepageTemplate
in app.js
to send HTML template as response.nodemon
:
nodemon
globally with npm install -g nodemon
.nodemon app.js
to auto-restart server on file changes.<head>
of HTML template.data/data.js
contains a sample array of book objects.