Tweterro POO é um projeto refatorado em orientado a objetos com classes.
Código original: Click to Download
POST /sign-up
Params | Type | Description |
---|---|---|
username |
string |
Required |
avatar |
string |
Required |
Status code | Cause |
---|---|
400 |
Requisição no formato incorreto |
"OK deu tudo certo"
POST /tweets
Params | Type | Description |
---|---|---|
tweet |
string |
Required |
username |
string |
Required |
Status code | Cause |
---|---|
400 |
Requisição no formato incorreto |
404 |
Usuário não encontrado |
"OK, seu tweet foi criados"
GET /tweets/:username
Params | Type | Description |
---|---|---|
username |
string |
Required |
[
{ "tweet": "Oi", "username": "Teste", "avatar": "https://..." },
{ "tweet": "Olá", "username": "Teste", "avatar": "https://..." },
{ "tweet": "Saudações", "username": "Teste", "avatar": "https://..." }
]
É necessário passar query params nessa rota
GET /tweets
Params | Type | Description |
---|---|---|
page |
number |
Required,greater than 1 |
[
{ "tweet": "Oi", "username": "Teste", "avatar": "https://..." },
{ "tweet": "Oi", "username": "Ronaldinho", "avatar": "https://..." },
{ "tweet": "Olá", "username": "Teste", "avatar": "https://..." },
{ "tweet": "Saudações", "username": "Teste", "avatar": "https://..." }
]
Clone o projeto
git clone https://github.com/ThVinicius/Tweteroo-Orientado-a-Objetos-back-end.git
Vá para o diretório do projeto
cd Tweteroo-Orientado-a-Objetos-back-end
Instale as dependências
npm install
Inicie o servidor
npm run dev