An API made for you to share your programming questions and get help from colleagues
POST /users
- 400: You have sent a invalid body, check your params
- 200: Success
[
{
token: uuid,
},
];
POST /questions
{
question: String, at least 10 characters, maximum 220 characters
userToken: String, is the token given on creating a user
tags: String, at least 2 characters, maximum 220 characters
}
- 400: You have sent a invalid body, check your params
- 401: You have not sent your token or your token is invalid
- 404: The user was not found
- 200: Success
[
{
id: questionId,
},
];
POST /questions/:questionId
{
answer: String, at least 10 characters, maximum 220 characters
}
- 400: You have sent a invalid body
- 401: You have not sent your token or your token is invalid
- 400: The question is already answered
- 404: The question was not found
- 200: Success
GET /questions/questionId
- 400: Invalid
- 404: Question not found
- 200: Success
{
"question": question,
"student": studentName,
"class": studentClass
"tags": tags,
"answered": Boolean,
"submitAt": submitionDate,
...
"answeredAt": answerDate,
"answeredBy": answerUserToken,
"asnwer": asnwer,
}
GET /questions
[
{
"question": question,
"student": studentName,
"class": studentClass
"tags": tags,
"answered": Boolean,
"submitAt": submitionDate,
},
]
git clone https://github.com/victordurco/full-stack-overflow-developer
cd full-stack-overflow-developer
npm i --force
Create a .env.dev file and fill it using your environment variables following the example at .env.example file
sudo su postgres
psql
CREATE DATABASE your_db_name
\c your_db_name
Copy everything in the DATABASE.sql file and paste on the terminal
You can not exit the postgres admin, and run
npm start