Lecturer Suggestion

  1. Decide which routes your app needs
  2. Code 'stubs' for each route
  3. Code small HTML pages to test the design
  4. Static HTML files instead of writing HTML from Express
  5. Covert static files to Handlebars templates
  6. Insert data into his templates - at first, hard-coded JSON
  7. Now, fetch the data from MongoDB database
  8. Add a header and footer and some CSS to main.hbs
npm init -y
package.json appears

npm install <package> [local or global]
npm install express

const <varname> = require('express')

npm install mongodb
  1. Decide :: what routes do we need to display these screens?
/food/123
/filter (GET and POST)

Target :: Snacks in a Van

Expectation → 100 vans and 100k customers

Customer App

Needs:

login:

Order:

Vender App

Menu

→ No hard coding

→ Don't breach the copyright

Current sales:

Location, distance and map

→ geo location (longitude, latitude) 4 decimal points

→ Get location via Geolocation API

→ display location

Live page


npm install md5

var md5 = require('md5');
console.log(md5('message'));

Database management

express

express.router