Para iniciar sua API localmente execute os seguintes comandos, nesta ordem:
iniciar Banco de Dados
psql -u user_name
CREATE DATABASE techarchive;
Configurar o ambiente
Create .env file
copy content of .env.example to .env
rename you user_name and password in .env
Configurar e instalar dependencias
python -m venv venv
pip install -r requirements.txt
flask db upgrade
flask run
localhost:5000
Content-Type: application/json
body
{
"user": "teste",
"password": "1234"
}
body
{
"name": "Nome Completo",
"description": "breve descrição",
"email": "[email protected]",
"password": "123456"
}
headers
Authorization: <TOKEN>
headers
Authorization: <TOKEN>
headers
Authorization: <TOKEN>
headers
Authorization: <TOKEN>
body
{
"name": "Nome Completo",
"description": "breve descrição",
"email": "[email protected]",
"password": "123456"
}
}
headers
Authorization: <TOKEN>
headers
Authorization: <TOKEN>
Just send what you want to change.
headers
Authorization: <TOKEN>
body
{
"news": {
"title": "Livro",
"author": "Author",
"content": "Long text",
"upvotes": 1,
"downvotes": 1,
"idle_time": 1,
"theme": "Computers,Programming",
"approved": bool
}
}
headers
Authorization: <TOKEN>
headers
Authorization: <TOKEN>
body
{
"news": {
"title": "Livro",
"author": "Author",
"content": "Long text",
"upvotes": 1,
"downvotes": 1,
"idle_time": 1,
"theme": "Computers,Programming",
"approved": bool
}
}