SUPPLIER
GET /supplier/all
retorna json com todos os fornecedores
POST /supplier/
Adiciona supplier
{
name: {type: String, required: true},
phone: {type: String, required: true},
}
USER
POST /user/
Adiciona user
{
name: {type: String, required: true},
email: {type: String, required: true, unique: true},
password: {type: String, required: true }
}
LOGIN
POST /login/
Efetua login
{
email: {type: String, required: true },
password: {type: String, required: true }
}
retorna
return res.json({
success: true,
token: token,
user: user
});
#PADRÕES DE RETORNO
SUCESSO
-> STATUS 200
-> NÂO CASO ESPECIFICADO SUCESSO RETORNA {} OBJETO VAZIO
ERROS / INSUCESSOS
-> STATUS 500 erro interno do servidor
-> STATUS 404 ROTA NAO ENCONTRADA