An api server starter kit using gin, mongodb, jwt authentication
goServe is a seed project for you to kickstart golang restful api project.It tries to mimic Django by providing essential package such as basic authentication, social authentication, database connection and more to come. However, unlike Django, goServe only tries to serve the needs of Single Page Application and mobile application.
- put this project into go src directory
- modify config.json to configure your app (mongodb url, jwt key, email)
- go run main.go
goServe uses Gin as the framework. Gin provides excellent middlewares and uses httprouter for its performance.
goServe uses Mgo as the MongoDB driver. Enjoy.
goServe implements the authentication flow with json web token. Token-based authentication provides better decoupling, scalability and real stateless api. For more information, go to ins and outs of token-based auth
Auth supports:
- email password
- facebook auth
- install Go and config GOPATH
- install Git and clone your project
- install Supervisor
- build your app into bin
- use Supervisord to keep process running in the background (property “directory” denotes where your app runs from. Thus, keep your JSON config file in this directory)