Skip to content

Bff2003/API-Surveys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

API-Surveys

API for creating surveys and voting on them

Main Logic

  • Everyone can create a survey
  • Everyone can update a survey
  • Everyone can answer a survey
    • When voted, the user can only vote one time for each survey
  • Everyone can see the results of a survey
  • Everyone can delete a survey

Routes

  • GET /api/surveys/
  • POST /api/surveys/
  • GET /api/surveys/:id/results
  • POST /api/surveys/:id/vote
  • PUT /api/surveys/:id
  • DELETE /api/surveys/:id

Models

{
    "_id": "5f8d4b2b4b9f9b1b3c3b2b1b",
    "Title": "You like Ice Cream?",
    "Votes": [
        {
            "IP": "127.0.0.1",
            "Timestamp": "2023-11-19T23:35:45.559+00:00"
        }
    ]
}

Installation

  1. Install Node.js
  2. Install MongoDB
  3. Clone this repository
  4. Run npm install in the src directory

How to use

  1. Run npm start in the src directory
  2. Your server is now running on localhost:3000

Features

  • Only the creator of a survey can update it
  • Only the creator of a survey can delete it
  • The creator can create a group of surveys

About

API for creating surveys and voting on them

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published