codegentemplate

command
v0.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 4 Imported by: 0

README

My App API

Getting Started

  1. Make sure you have Go installed.
  2. Clone the repo
git clone https://grest.dev/cmd/codegentemplate.git
  1. Go to the directory and run go mod tidy to add missing requirements and to drop unused requirements
cd codegentemplate && go mod tidy
  1. Setup your .env file
cp .env-example .env && vi .env
  1. Start
go run main.go

Code Documentation

  1. Install godoc
go install golang.org/x/tools/cmd/godoc@latest
  1. Run godoc in codegentemplate directory
godoc -http=:6060
  1. Open http://localhost:6060/pkg/grest.dev/cmd/codegentemplate in browser

Open API Documentation

  1. Update your open api documentation
go run main.go update
  1. Start
go run main.go
  1. Open http://localhost:4001/api/docs in browser

Test

  1. Make sure you have db with name main_test.db with credentials same as DB_XXX
  2. Test all with verbose output that lists all of the tests and their results.
ENV_FILE=$(pwd)/.env go test ./... -v
  1. Test all with benchmark.
ENV_FILE=$(pwd)/.env go test ./... -bench=.

Build for production

  1. Compile packages and dependencies
go build -o codegentemplate main.go
  1. Setup .env file for production
cp .env-example .env && vi .env
  1. Run executable file with systemd, supervisor, pm2 or other process manager
./codegentemplate

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app
app is a package to accommodate classes or common variables that are used in almost all end points.
app is a package to accommodate classes or common variables that are used in almost all end points.
src
codegentemplate
codegentemplate is a package related to codegentemplate data.
codegentemplate is a package related to codegentemplate data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL