Skip to content

Go server with Fiber and PostgreSQL

root27/go-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go server with PostgreSQL

This is a simple Go server with Fiber and PostgreSQL database.

Running the server

go run .

Running the PostgreSQL database

docker run --name postgres  -e POSTGRES_USER=test -e POSTGRES_PASSWORD=123 -p 5432:5432 -d postgres

API

Create a user

 

curl -X POST -H "Content-Type: application/json" -d '{"name":"John Doe", "age": 12}' http://localhost:3000/create

Get all users

curl -X GET http://localhost:3000/getAll

Get user by id

curl -X GET http://localhost:3000/get/:id

Update user by id

curl -X POST -H "Content-Type: application/json" -d '{"name":"John Doe", "age": 12}' http://localhost:3000/update/:id

Delete user by id

curl -X DELETE http://localhost:3000/delete/:id

About

Go server with Fiber and PostgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages