This is a simple CRUD application built with Go and PostgreSQL. It provides an HTTP API for managing products and users.
- Clone the repository:
git clone git@github.com:badimalex/goshop.git
- Install dependencies:
go mod download
-
Create a
config.yaml
file with the project configuration (you can useconfig.example.yaml
as a template). -
Start the server:
go run ./cmd
The following API endpoints are available:
POST /register
- register a new userPOST /login
- log in a user and get a token
POST /products
- create a new productGET /products
- search for products by name (name
query parameter)GET /products/:id
- get a product by IDPUT /products/:id
- update a product by IDDELETE /products/:id
- delete a product by ID