Skip to content

praveen836845/Polling-system-api-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POLLING_SYSTEM_API

Introduction

Creating a polling system api where anyone can create questions with options and also add votes to it. It is built using Express, Nodejs, MongoDB.


Features

  • Users can create questions (you can add as many questions as you want).
  • Users can add options to a question.
  • Users can add a vote to an option of question.
  • Users can delete a question -> A question can't be deleted if one of it's options has votes.
  • Users can delete an option -> An option can't be deleted if it has even one vote given to it.
  • Users can view a question with it's options and all the votes given to it.

Routes & URL

  • /questions/create

    To create a new question hit the following URL with a post request:

    http://localhost:8000/api/questions/create
  • /options/:id/create

    To create a new option for a question hit the following URL with a post request:

    http://localhost:8000/api/questions/id/options/create
  • /options/:id/addVote

    To increment the count of votes on an option, hit the following URL with a get request:

    http://localhost:8000/api/options/id/addVote
  • /questions/:id

    To view a question and it’s options, hit the following URL with a get request:

    http://localhost:8000/api/questions/id
  • /options/:id/delete

    To delete an option, hit the following URL with a delete request:

    http://localhost:8000/api/options/id/delete
  • /questions/:id/delete

    To delete a question, hit the following URL with a delete request:

    http://localhost:8000/api/questions/id/delete

Releases

No releases published

Packages

No packages published