Week 09 - The Web and Your Own Web Servers with Express

Objectives

  • You will understand basics of HTTP which powers the web

  • You will be able to build custom web application servers

Understanding and HTTP Calls Through Debugging

  • You will understand how to inspect HTTP with a VS Code extension

  • You will be able to generate fetch code and curl calls using the VS Code extension

Understanding Express and Web Basics

  • You will understand how to create a basic express app
  • You will understand how to use router directly and also the alternatives of get, all and post

Adding Functionality to a Web Server

  • You will be be able to write code without using router directly and instead use the alternatives of get, all and post

Reference Resources

Node http which Express builds functionality onto and what Express adds for functionality

https://blog.risingstack.com/your-first-node-js-http-server/

Installing Express into any Node Project npm install --save express

Installing Nodemon for Fast Development npm install --save-dev nodemon

Nodemon

https://nodemon.io/

Express

https://www.npmjs.com/package/express

Express Listen Function

https://expressjs.com/en/api.html#app.listen

Express Route

https://expressjs.com/en/api.html#app.route

Express Static file delivery

https://expressjs.com/en/starter/static-files.html

Express get Function

https://expressjs.com/en/api.html#app.get.method

Express post Function

https://expressjs.com/en/api.html#app.post.method

Express all Function

https://expressjs.com/en/api.html#app.all

Express Response send Function

https://expressjs.com/en/api.html#res.send

Express Response sendStatus Function

https://expressjs.com/en/api.html#res.sendStatus

Express Request Params

https://expressjs.com/en/api.html#req.params

Express Response Status Function

https://expressjs.com/en/api.html#res.status