Go REST API Boilerplate
This is a boilerplate project for building a Modular REST API in Go, aimed to speed up the process of starting a new project and structuring the app.
It uses the following major libraries:
Usage
A .env.example
file is provided in the root directory. Copy it to .env
and adjust the values to your needs.
# App
APP_PORT=
# Database
DB_DSN="database://user:password@host:port/dbname?sslmode=&TimeZone="
DB_CONN_OPEN=
DB_CONN_IDLE=
DB_CONN_LIFETIME=
To initialize new modules, run the following command:
go run scripts/module.go <module name>
To run the app, execute the following command:
go run cmd/app/main.go