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.yamlfile with the project configuration (you can useconfig.example.yamlas a template). -
Start the server:
go run ./cmdThe 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 (namequery parameter)GET /products/:id- get a product by IDPUT /products/:id- update a product by IDDELETE /products/:id- delete a product by ID