This project a golang API that provides endpoints for managing Cars catalogs and there types.
- Clone project
git clone https://github.com/MarioMedWilson/car-catalog.git
- Change into the project directory
cd car-catalog
- Install pkg
go mod download
- Build Project
go build -o main
- Run Projcet
./main
docker-compose up
Note that if it didn't from first time terminate and rerun
Method | URL | Description |
---|---|---|
GET |
/car |
Retrieve all cars. |
POST |
/car |
Create a new car. |
GET |
/car/:id |
Retrieves a specific car by ID. |
PUT |
/car/:id |
Updates a specific car by ID. |
DELETE |
/car/:id |
Deletes a specific car by ID. |
GET |
/car/?filter={...} |
Retrieve cars with filter. |
Method | URL | Description |
---|---|---|
GET |
/car-type |
Retrieve all cars types. |
POST |
/car-type |
Create a new car type. |
GET |
/car-type/:id |
Retrieves a car type by ID. |
PUT |
/car-type/:id |
Updates a car type by ID. |
DELETE |
/car-type/:id |
Deletes a car type by ID. |
Request body create type
{
"type": "Diesel cars"
}
Request body create car
{
"name": "F-Type",
"make": "Jaguar",
"modelyear": 2012,
"color": "black",
"speedrange": "0-350",
"TypeID": 2
}