modulepackage
0.0.0-20220125190604-9237c10da987
Repository: https://github.com/edwinnduti/go-postgres.git
Documentation: pkg.go.dev
# README
postgres and Golang API.
Requirements:
- Postgresql
- Golang
- Add .env file with values to specified keys:
HOST= DBPORT= USER= DBNAME= PASSWORD=
Run code locally
$ git clone https://github.com/edwinnduti/go-postgres.git
$ cd go-postgres
$ go mod download
$ go run main.go
Run code using Docker
$ git clone https://github.com/edwinnduti/go-postgres.git
$ cd go-postgres
$ sudo docker build -t startapp -f Dockerfile .
$ sudo docker run -it -p 8010:8010 startapp
Available :
function | path | method |
---|---|---|
Create user | /api | POST |
Get single user | /api/{user_id} | GET |
Get All users | /api/users | GET |
Delete single user | /api/user/{user_id} | DELETE |
update single user | /api/user/{user_id} | UPDATE |
Have a day full of ❤️