A boilerplate application for building backend service using go.
controllers/
- defines your app routes and their logicutils/
- code and functionality to be shared by different parts of the projectmiddlewares/
- Express middlewares which process the incoming requests before handling them down to the routesmodels/
- represents data, implements business logic and handles storageconfig/
- this folder contains configuration files, such as application settings, constants, ..., etc.public/
- contains all static files like images, styles and javascript assetsglide.yaml
- dependencies pacakge managementglide.lock
- paired withglide.yaml
.editorconfig
- settings of editor such as indent size/style, charset, newline character, ..., etc. Please install EditorConfig to automatically apply settingsmain.go
- app start from here
make sure you have GOPATH set up properly
To build
docker build -t boilerplate .
To run
docker run -v `pwd`:/go/src/app -e "dev=1" -p 3000:3000 --name="test" boilerplate`
-e dev=1 to turn on dev mode
- please put
_test.go
files adjacent to the file, e.g.controllers/index.go
will havecontrollers/index_test.go
for testing
- Environment specific configs