Task: Need to create an API where anyone can create questions with options and also add votes to it
- Create a question
- Add options to a question
- Add a vote to an option of question
- Delete a question → (optional: A question can’t be deleted if one of it’s options has votes)
- Delete an option → (optional: An option can’t be deleted if it has even one vote given to it)
- View a question with it’s options and all the votes given to it
- /questions/create (To create a question)
- /questions/:id/options/create (To add options to a specific question)
- /questions/:id/delete (To delete a question)
- /options/:id/delete (To delete an option)
- /options/:id/add_vote (To increment the count of votes)
- /questions/:id (To view a question and it’s options)
CSV_Upload/
|── |config/
│ | ├── mongoose.js
| |
├── routes/
│ | ├── api/
│ ├── index.js
| |
├── controllers/
│ ├── OptionsController.js
│ ├── QuestionsController.js
| |
├── models/
│ ├── options.js
│ ├── questions.js
| |
├── package-lock.json
├── package.json
├── README.md