- Install mongodb and nodejs
- Check if mongodb , nodejs ans npm are installed successfully
- After pulling the folder , open the terminal in that folder i.e. set the working directory as the folder in which 'app.js' file is present
- Run 'npm install'
- Create a database in mongodb , named as 'pcondb'.
- Run 'npm start' in your working directory
- Open mongodb & Create a collection named 'members' and import the 'member_pcon.json' file from 'public' folder into the 'members' collection
- Install 'Postman' from chrome extensions to handle different http requests
- From postman send a "GET" request at "http://localhost:3000/api/members", if you get the members json file in response you are good to go.
- To add a notice send a "POST" request to "http://localhost:3000/api/notices" and in "body" select "raw" and "file format as 'json'"
schema is as
{
"head" : "heading of the notice",
"body" : "Description of the notice",
"from" : "start time of workshop if any",
"to" : "end time of workshop if any"
}
- To see all the notices , send a "GET" request to "http://localhost:3000/api/notices"
- Similarly add the subscribers and get the response as json by sending get request.
schema is as
{
"email" : "email of subscriber"
}
NOTE: For GUI of mongodb use "mongodb compass".
//author:Shubhamkr17