Welcome to Polling System API, your go-to solution for creating, managing, and voting on polls effortlessly!
Here's a glimpse of what PollMaster API has to offer:
🌐 Create, manage, and delete questions and options.
🗳️ Cast votes for your favorite options.
🔥 Seamlessly powered by Node.js and MongoDB.
Here's the structure of our project:
📁 config
└─ mongoose.js
📁 controller
└─ home_controller.js
└─ option_controller.js
└─ question_controller.js
📁 controllers
└─ option.js
└─ question.js
📁 models
└─ option.js
└─ question.js
📁 node_modules
📁 routes
└─ index.js
└─ option.js
└─ question.js
📄 .env
📄 .gitignore
📄 index.js
📄 package-lock.json
📄 package.json
To get started with PollMaster API, follow these simple steps:
- Clone this repository.
- Configure your MongoDB connection in
config/mongoose.js
. - Install the required Node.js packages using
npm install
. - Start the server with
node index.js
. - Access the API at
http://localhost:YOUR_PORT
.
Here are some common API endpoints to get you started:
- Create a new question:
POST /questions/create
- Add options to a question:
POST /questions/question ID/options/create
- Vote for an option:
GET /options/:optionId/add_vote
- Delete a question:
POST /questions/:questionId/delete
Refer to our API documentation for detailed usage instructions.
We welcome contributions! Feel free to open issues and submit pull requests to help us improve PollMaster API.
Happy polling! 🗳️