We are using dep for dependency management.
go get -u github.com/golang/dep/cmd/dep
dep ensure
You are ready to Go :)
All request will the authenticated against Auht0.
If you wanna disable it, just remove v1.Use(middlewares.Authentication)
.
You can configure your Auth0 settings in .env
file.
AUTH0_JWKS=https://{YOUR_AUTH0_TENANT_DOMAIN}/.well-known/jwks.json
AUTH0_AUDIENCE=http://{{YOUR_AUTH0_API_DOMAIN}
AUTH0_ISSUER=https://{YOUR_AUTH0_TENANT_DOMAIN}.auth0.com/
Swagger is a set of open-source tools built around the OpenAPI Specification that can help you design, build, document and consume REST APIs.
For use Swagger in this project, you'll need gin-swagger.
Install swag
using go get
go get github.com/swaggo/swag/cmd/swag
You can generate or regenerate your docs using the command below:
swag init
.env
file should have all variables you'll need on your environment.
godotenv
will read your .env
file from the project folder or projetc/secrets
folder and create the envs.
You can run this code easily on a Docker container. Just run the following commands:
docker build -t your-image .
docker run -p 9000:9000 your-image