How to run it:
- clone the directory
git clone https://github.com/nurdtechie98/LetsGetItDone.git
- enter the directory
cd LetsGetItDone
- download all the dependencies
npm i
- goto .env file
- start mongoDB
- specify PORT (if only you dont want it on 8080 for some reson) and DB_URI(most of will have it running locally on 27017 so no need)
- goto terminal and during development run the command
npm run watch
Experiment 3
Routing
- Basic Routing
- Basic middleware routing: use define
- Accessing parameter in routing param is id see route defn and usage
- Handling 404 errors: done using custom middleware (note: in app.js used at last, after all routes)
- Sample routes for an application
Demonstrate the use of JSON API with express.js
Server and client application
TLS: demonstrate the use of Server and client application using node.jsImplemeted using websockets
Setting cookies with cookie-parser: Demonstrate an example for setting and reading cookies using the cookie-parser module
File operation
Authenticate with an email address
Cluster module
- main code
- worker code basically our normal entire app.js in function
- to run `npm run cluster`
Prompting user input via CLI
To run `node utils/prompt.js`File Upload
- routes
- html file
- To upload file go to upload file link
- Check the uploads directory in your root directory, you will find all your uploaded files