1 - Instalar dependĂȘncias do node
npm install
2 - Iniciar MongoDB
sudo mongod
3 - Iniciar sevidor node
npm run dev
4 - Exemplos rotas da API
GET http://localhost:3000/api/student/
POST http://localhost:3000/api/student
{
"name": "Eduardo Melo",
"age": 27,
"class": "Turma A"
}
PUT http://localhost:3000/api/student/5b06cf0c6d0fdb7b6f876003
{
"name": "Eduardo Moraes de Melo",
"age": 27,
"class": "Turma A"
}
DELETE http://localhost:3000/api/student/5b06cf0c6d0fdb7b6f876003
GET http://localhost:3000/api/class/
POST http://localhost:3000/api/class/
{
"name": "Tuma A",
"students": "{id: 5b06cf0c6d0fdb7b6f876003}",
"teacher": "Loren",
}
PUT http://localhost:3000/api/class/5b06d2cd4a26310190be13c5
{
"name": "Tuma A",
"students": "{id: 5b06cf0c6d0fdb7b6f876003}",
"teacher": "Stella",
}
DELETE http://localhost:3000/api/class/5b06d2cd4a26310190be13c5