This is an Products API CRUDproducts. It is written in Go and uses the Echo framework and a MySQL database.
- Clone the repository.
- Install the dependencies with
make install
. - Copy
.env.example
to.env
and fill in your environment variables. - Run the migrations with
make migrations_up
- Finally, start the application with live-reload enabled running
make dev
.
All API endpoints are already documented in the Swagger available at the /api/v1/docs/index.html
route.
Here is an overview:
GET /api/v1/products
: List all products.POST /api/v1/products
: Create a new product.GET /api/v1/products/{id}
: Get a specific product by its ID.PUT /api/v1/products/{id}
: Update a specific product by its ID.DELETE /api/v1/products/{id}
: Delete a specific product by its ID.
Unit tests can be run with make test
.