https://crud-api-nseo.onrender.com
-
GET
/guns- Get all guns.
- Response:
200 OK- Array of guns.
-
GET
/guns/:id- Get a gun by ID.
- Response:
200 OK- Gun object, or404 Not Found.
-
POST
/guns- Create a new gun.
- Request Body:
model(string, required)caliber(string, required)magazineCapacity(integer, required)weight(string, required)barrelLength(string, required)sights(string, required)action(string, required)
- Response:
201 Created, or400 Bad Request.
-
PUT
/guns/:id- Update a gun by ID.
- Request Body: Same as POST.
- Response:
200 OK, or404 Not Found.
-
DELETE
/guns/:id- Delete a gun by ID.
- Response:
200 OK, or404 Not Found.
-
GET
/suppressors- Get all suppressors.
- Response:
200 OK- Array of suppressors.
-
GET
/suppressors/:id- Get a suppressor by ID.
- Response:
200 OK- Suppressor object, or404 Not Found.
-
POST
/suppressors- Create a new suppressor.
- Request Body:
name(string, required)caliber(string, required)weight_oz(number, required)material(string, required)
- Response:
201 Created, or400 Bad Request.
-
PUT
/suppressors/:id- Update a suppressor by ID.
- Request Body: Same as POST.
- Response:
200 OK, or404 Not Found.
-
DELETE
/suppressors/:id- Delete a suppressor by ID.
- Response:
200 OK, or404 Not Found.
- 400 Bad Request: Invalid input.
- 404 Not Found: Resource not found.
- 500 Internal Server Error: Unexpected error.