command
module
Version:
v0.0.0-...-63580ab
Opens a new window with list of versions in this module.
Published: Aug 29, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Go Fiber Web Server Template
A starter template for web-server in Go using Fiber, Cobra, and Viper
External Modules
- Fiber v3 – HTTP web framework
- Cobra – CLI framework, provides
serve command for starting web server
- Viper – Load and parse config files/env vars
- Zerolog – Structured logging
- invopop/validation – Lightweight request/config validation
Features
- Fiber HTTP Server with example routes, error handling and graceful shutdown
- CLI commands management using Cobra. Root command with common logic and Serve for Web Server
- Config management via Viper, including config validation via invopop/validation
- Dependency Injection Container structure
Setup
Prerequisites
Installation
git clone https://github.com/PavleProd/go-fiber-template.git
cd go-fiber-template
go mod download
Commands
task run: Runs serve command in temporary binary
task build Builds binaries into /bin folder and Runs serve command
task test: Runs tests with formatted output
task lint: Runs code linting with premade configuration (.golangci.yml)
These commands can be easily used as GitHub Actions
Example Endpoint
curl -X POST "http://localhost:8080/example" -H "Content-Type: application/json" -d '{"message":"hello world"}'
Response: 200 OK
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
|
|
|
pkg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.