# README
My App API
Getting Started
- Make sure you have Go installed.
- Clone the repo
git clone https://grest.dev/cmd/codegentemplate.git
- Go to the directory and run go mod tidy to add missing requirements and to drop unused requirements
cd codegentemplate && go mod tidy
- Setup your .env file
cp .env-example .env && vi .env
- Start
go run main.go
Code Documentation
- Install godoc
go install golang.org/x/tools/cmd/godoc@latest
- Run godoc in codegentemplate directory
godoc -http=:6060
- Open http://localhost:6060/pkg/grest.dev/cmd/codegentemplate in browser
Open API Documentation
- Update your open api documentation
go run main.go update
- Start
go run main.go
- Open http://localhost:4001/api/docs in browser
Test
- Make sure you have db with name
main_test.db
with credentials same as DB_XXX - Test all with verbose output that lists all of the tests and their results.
ENV_FILE=$(pwd)/.env go test ./... -v
- Test all with benchmark.
ENV_FILE=$(pwd)/.env go test ./... -bench=.
Build for production
- Compile packages and dependencies
go build -o codegentemplate main.go
- Setup .env file for production
cp .env-example .env && vi .env
- Run executable file with systemd, supervisor, pm2 or other process manager
./codegentemplate
# Packages
app is a package to accommodate classes or common variables that are used in almost all end points.
No description provided by the author
No description provided by the author