This is a RESTful API for managing products, built with Go, Gin, and GORM.
To run the application using Docker Compose:
- Make sure you have Docker and Docker Compose installed
- Run the following commands:
cp .env.example .env
docker-compose up -d --build
You may have to restart the api container by running:
docker-compose restart api
You can access the endpoints on http://localhost:8080
There is also a postman collection: products-api.postman_collection.json
that you can import.
To run the tests you have to run the following commands:
chmod +x run_tests.sh
sed -i 's/\r$//' run_tests.sh
./run_tests.sh
GET /products?page=1&limit=10
: List all products (with pagination)GET /products/:id
: Get a specific productPOST /products
: Create a new productPATCH /products/:id
: Update an existing productDELETE /products/:id
: Delete a product