This is basic learning project for Authetication using a Go framework named as GIN and an ORM (Object Relational Mapping) library GORM
install Go install postgres database, download pgAdmin (client for postgres) or download a client extension in vs code editor
- clone this repository
https://github.com/xerofenix/gin-jwt
or
https://gitlab.com/xerofenix/git-jwt
- Make
.env
in "gin-jwt" directory and add the following with your credentials
PORT=3000(or any port that you want to access on)
DB_URL="host=your-db-host user=-db-user password=-db-password dbname=db-name port=-db-port sslmode=disable TimeZone=Asia/Shanghai"
SECRET=any-secret-code
- Open termianl in the "gin-jwt" directory and run
go run main.go
- Open the browser and goto https://localhost:300 or
http://localhost:you-port (if chaged in .env)