Welcome to the Nexu Backend Coding Exercise! This README provides information about the available routes and parameters for this API.
-
GET /brands
-
GET /brands/:id/models
-
POST /brands
-
POST /brands/:id/models
-
PUT /models/:id
-
GET /models
- model_name (required)
- average_price (optional)
- average_price (required)
- greater (optional)
- lower (optional)
Certainly! Here are some examples of how you can use the endpoints described in the Nexu Backend Coding Exercise:
GET /brands
This endpoint retrieves a list of all brands with their models average_price
GET https//nexu.exti.mx/API/brands
GET /brands/:id/models
This endpoint retrieves models for a specific brand by providing the :id of the brand.
GET https//nexu.exti.mx/API/brands/1/models
POST /brands
This endpoint allows you to create a new brand. You need to include the brand name in the request body. (use POST or form-data)
POST https//nexu.exti.mx/API/brands
"brand_name": "Toyota"
POST /brands/:id/models
This endpoint allows you to create a new model for a specific brand. You need to provide the brand ID in the URL and include the model name and optional average price in the request body. (use POST or form-data)
POST https//nexu.exti.mx/API/brands/1/models
"model_name": "Camry", "average_price": 280000
PUT /models/:id
This endpoint allows you to update the information for a specific model by providing the model ID. You need to include the updated average price in the request body. (use GET format ?average_price=125000)
PUT https//nexu.exti.mx/API/models/1?average_price=125000
GET /models
This endpoint retrieves models within a specified price range. You can include the optional parameters greater and lower in the query string to filter models.
GET https//nexu.exti.mx/API/models?greater=250000&lower=350000
Feel free to use these routes and parameters to interact with the API and perform various operations related to brands and models.
This project was deployed in https://nexu.exti.mx/API
You can test it using the next endpoints collection in postman https://api.postman.com/collections/4979939-01a63d21-d349-430a-91a5-686db75d9962?access_key=PMAT-01HBSY3MTNPVBNHPCSGJ6Z60NP