Backend code for a poll creation website
This is the backend code thst has the following functions:
- Create and post a new poll to the database
- Get all polls from the database
- Post new vote options for a created poll
- Get the options for a poll
- Post your vote
- Get the most voted option with the amount of votes
- Clone this repository
- Open it in your preferred coding platform
- Run the npm i command to install dependencies
- Create a .env file and paste the fllowing variables there "MONGO_URI=mongodb://localhost:27017" and "PORT=5000"
- Run de mongodb command "mongod --dbpath ~/.mongo" in a separate terminal
- Run node app.js to start the server locally
- Use thunderclient or similar to try out the paths
- Enjoy 🙂