Demo shows:
- Using the URL library
- Setting route callbacks via method and path
- Extracting POST data from a request
Run $ node app.js
. If you wish you may set a different port with a subsequent command-line argument (e.g. $ node app.js 4000
).
Demo for parsing HTTP requests and basic routing in Node
JavaScript