Skip to content

xerofenix/gin-jwt

Repository files navigation

About the Project

This is basic learning project for Authetication using a Go framework named as GIN and an ORM (Object Relational Mapping) library GORM

Prerequisit

install Go install postgres database, download pgAdmin (client for postgres) or download a client extension in vs code editor

How to run locally

  1. clone this repository
https://github.com/xerofenix/gin-jwt

or

https://gitlab.com/xerofenix/git-jwt
  1. 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
  1. Open termianl in the "gin-jwt" directory and run
go run main.go
  1. Open the browser and goto https://localhost:300 or http://localhost:you-port (if chaged in .env)

About

This is simple JWT Auth in Go using gin framework

Topics

Resources

Stars

Watchers

Forks