https://github.com/create-go-app/chi-go-template
📝 Production-ready backend template with go-chi router for Create Go App CLI.
https://github.com/create-go-app/chi-go-template
backend-template cgapp chi-backend-template create-go-app docker go-chi golang template-project
Last synced: 26 days ago
JSON representation
📝 Production-ready backend template with go-chi router for Create Go App CLI.
- Host: GitHub
- URL: https://github.com/create-go-app/chi-go-template
- Owner: create-go-app
- License: apache-2.0
- Created: 2021-09-24T04:33:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-05T15:43:53.000Z (over 3 years ago)
- Last Synced: 2024-06-20T17:40:04.283Z (11 months ago)
- Topics: backend-template, cgapp, chi-backend-template, create-go-app, docker, go-chi, golang, template-project
- Language: Go
- Homepage: https://github.com/create-go-app/cli/wiki
- Size: 23.4 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-chi backend template for [Create Go App CLI](https://github.com/create-go-app/cli)
[Chi](https://go-chi.io/#/) is a lightweight, idiomatic and composable router for building Go HTTP services.
## ⚡️ Quick start
1. Create a new project with Fiber:
```bash
cgapp create# Choose a backend framework:
# net/http
# fiber
# > chi
```2. Rename `.env.example` to `.env` and fill it with your environment values.
3. Install [Docker](https://www.docker.com/get-started) and the following useful Go tools to your system:- [golang-migrate/migrate](https://github.com/golang-migrate/migrate#cli-usage) for apply migrations
- [github.com/securego/gosec](https://github.com/securego/gosec) for checking Go security issues
- [github.com/go-critic/go-critic](https://github.com/go-critic/go-critic) for checking Go the best practice issues
- [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) for checking Go linter issues4. Run project by this command:
```bash
make docker.run
```5. Go to [127.0.0.1:5000/hc/status](http://127.0.0.1:5000/hc/status) and see `HTTP 200 OK`.
## 📦 Used packages
| Name | Version | Type |
|-----------------------------------------------------------------------| -------- | ---------- |
| [go-chi/chi](https://github.com/go-chi/chi) | `v5.0.7` | core |
| [joho/godotenv](https://github.com/joho/godotenv) | `v1.4.0` | config |## ⚙️ Configuration
```ini
# .env# Stage status to start server:
# - "dev", for start server without graceful shutdown
# - "prod", for start server with graceful shutdown
STAGE_STATUS="dev"# Server settings:
SERVER_HOST="0.0.0.0"
SERVER_PORT=5000
SERVER_READ_TIMEOUT=5
SERVER_WRITE_TIMEOUT=10
SERVER_IDLE_TIMEOUT=120
```## ⚠️ License
Apache 2.0 © [Vic Shóstak](https://shostak.dev/) & [True web artisans](https://1wa.co/).