Skip to content

Example of Go app (Postgresql, Rest api, JWT auth)

Notifications You must be signed in to change notification settings

badimalex/goshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go CRUD Application with PostgreSQL

This is a simple CRUD application built with Go and PostgreSQL. It provides an HTTP API for managing products and users.

Installation

  1. Clone the repository:
git clone git@github.com:badimalex/goshop.git
  1. Install dependencies:
go mod download
  1. Create a config.yaml file with the project configuration (you can use config.example.yaml as a template).

  2. Start the server:

go run ./cmd

Usage

The following API endpoints are available:

User Endpoints

  • POST /register - register a new user
  • POST /login - log in a user and get a token

Product Endpoints

  • POST /products - create a new product
  • GET /products - search for products by name (name query parameter)
  • GET /products/:id - get a product by ID
  • PUT /products/:id - update a product by ID
  • DELETE /products/:id - delete a product by ID

About

Example of Go app (Postgresql, Rest api, JWT auth)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages