This API was built with Express for the project onlyDevs. It includes a backend made with PostgreSQL that contains 50 front-end developer interview questions that also holds user submitted answers.
- GET front-end developer interview questions.
- POST user submitted answers.
- GET user submitted answers for specific questions.
- POST user answers to either upvote or downvote
Clone the repository and install dependencies
git clone git@github.com:andrewvallejo/only-devs-api.git
cd only-devs-api
npm install
To deploy, cd
into the project folder and run
npm start
Purpose | URL | Verb | Request Body |
---|---|---|---|
Get all questions | https://onlydevs-api.herokuapp.com/questions |
GET | All questions each with {"id": <Integer>, "question": <String>, "answers": <Array>} |
Get specific question | https://onlydevs-api.herokuapp.com/questions/:id |
GET | {"id": <Integer>, "question": <String>, "answers": <Array>} |
Submit an answer to question | https://onlydevs-api.herokuapp.com/question/:id |
POST | {"answer": <String>} |
Add score from answer | https://onlydevs-api.herokuapp.com/questions/answer/vote |
POST | {"question_id": <Integer>,"answer_id": <Integer>, "vote": "upvote"} |
Remove score from answer | https://onlydevs-api.herokuapp.com/questions/answer/vote |
POST | {"question_id": <Integer>,"answer_id": <Integer>, "vote": "downvote"} |