Code Monkey home page Code Monkey logo

pollingapi's Introduction

pollingAPI

It is an API for Polling which helps a User to raise a Question, he/she or others can add option to that question and can vote on that options as well.

Index

How to Setup the Code into your System

  • Fork this repository into your github account (create one if you don't have it yet)
  • Clone it to your system (git clone)
  • In the terminal run git remote add upstream https://github.com/pratik-dutta/pollingAPI.git (this is for taking a fresh update of the code anytime in the future)

Cloning the repository using VS Code

  • Open VS Code.
  • Go to View > Terminal.
  • To clone the repo to your desktop, change the directory to desktop by running the command cd desktop.
  • In the terminal, run git clone https://github.com/pratik-dutta/pollingAPI.git.
  • A folder/directory should be created on your desktop.
  • Open that folder in VS Code, go to File > Open.
  • Run npm install to download dependencies of the project or you can download it by seeing dependencies in package.json.
  • Now you're good to go!

Tech Used in it

Stack: NodeJs, ExpressJs, MongoDB

API's Functionality


This API helps to performs the following function


Following is the description of all the function mentioned above.
  • Create a Question

    Route: /questions/create
    This route helps to create a question.
  • Add Option to a Question

    Route: /questions/:id/options/create
    This route helps to add different options to a particular question. The id of question is specified in the route params. The opions should be unique.
  • Delete a Question

    Route: /questions/:id/delete
    This route helps to delete a question. It deletes the question only if it's option doesn't have votes in it.
  • Add vote to an Option

    Route: /options/:id/add_vote
    This route helps to increment the vote of a particular option. The option id is specified in the route.
  • Delete an Option

    Route: /options/:id/delete
    This route helps to delete an option of a question. It deletes the option only if there is no votes.
  • View a Question

    Route: /questions/:id
    This route helps to view a question and all the option associated with it and the votes of option as well.

Support

Feel free to contact at pratikdutta.786(at)gmail(dot)com for any query.

pollingapi's People

Contributors

dutta-pratik avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.