Scaffold to build API using gin gonic framework
You must change the main package directory for example:
When you need use the settings package, the import sentence would be
import "gin-gonic/pkg/setting"Change for this:
import "your-dir/pkg/setting"Run the following command:
docker build -t app-name -f dev.Dockerfile .When the build is done, run:
docker run --rm -it -p port:port app-name go run main.go apiRun the following command:
docker build -t app-name .When the build is done, run:
docker run --rm -it -p port:port app-name main apiENV CLIENT_ID p@ssw0rd!
ENV CONN_STRING mongodb+srv://user:pass@127.0.0.1/bdname
ENV DB_HOST localhost
ENV DB_NAME dbname
ENV DB_PASS password
ENV DB_PORT 5432
ENV DB_TYPE postgres
ENV DB_USER user
ENV DEBUG true
ENV JWT_SECRET Aech7eepaesi8goo8phu8laech8aet4yie1kahsa4phohLuiHu9aeph6oa9Eoth7
ENV PAGE_SIZE 25
ENV PORT 8080
ENV READ_TIMEOUT 60
ENV REDIS_URL 172.0.17.2
ENV RUN_MODE debug
ENV WRITE_TIMEOUT 60This scaffold will be upgraded to support gracefully restart to speed up the development process. The Dockerfile will change to compile the app and run the binary.