- Language: Python
- Framework: FastAPI
- Database: MongoDB (M0 Free Cluster of MongoDB Atlas)
- Deploy: Render
Deployed URL: https://cosmocloud-backend-assesment.onrender.com/
- Method: POST
- Endpoint:
/students
- Request Body:
{ "name": "string", "age": 0, "address": { "city": "string", "country": "string" } }
- Response Status Code: 201
- Response Body:
{ "id": "string" }
- Method: GET
- Endpoint:
/students
- Parameters:
country
: To apply a filter by country. Optional.age
: Filters records with an age greater than or equal to the provided age. Optional.
- Response Status Code: 200
- Response Body:
{ "data": [ { "name": "string", "age": 0 } ] }
- Method: GET
- Endpoint:
/students/{id}
- Parameters:
id
: ID of the student (required)
- Response Status Code: 200
- Response Body:
{ "name": "string", "age": 0, "address": { "city": "string", "country": "string" } }
- Method: PATCH
- Endpoint:
/students/{id}
- Parameters:
id
: ID of the student (required)
- Request Body:
{ "name": "string", "age": 0, "address": { "city": "string", "country": "string" } }
- Response Status Code: 204 (No Content)
- Method: DELETE
- Endpoint:
/students/{id}
- Parameters:
id
: ID of the student (required)
- Response Status Code: 200
- Response Body:
{ "data deleted" }