Web service CRUD using Golang with GIN for create REST api, MySQL as database, Viper as environment variable, JWT for secure service and Cookies to store token.
Prerequisites
- Firstly, we need to get Gin, MySQL, Viper, jwt and ksuid for UUID library dependencies for install it
go get github.com/gin-gonic/gin
go get gorm.io/gorm
go get gorm.io/driver/mysql
go get github.com/spf13/viper
go get golang.org/x/crypto/bcrypt
go get github.com/dgrijalva/jwt-go
go get github.com/segmentio/ksuid
-
Import dump.sql to your MySQL and configure your credential in folder resource.
-
To run application,open cmd in your project directory and type
go run main.go