Skip to content

Fiber backend template

go version go cover go report license

Fiber is an Express.js inspired web framework build on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind.

  • Create a new project:
cgapp create
  • Run project by this command:
task -s

What's task command?

We're using Taskfile1 as task manager for running project on a local machine by default.

.
├── .dockerignore
├── .editorconfig
├── .gitignore
├── Dockerfile
├── Taskfile.yml
├── go.mod
├── go.sum
├── main.go
├── configs
│   └── apiserver.yml
├── static
│   └── index.html
└── pkg
    └── apiserver
        ├── config.go
        ├── config_test.go
        ├── error_checker.go
        ├── error_checker_test.go
        ├── new_server.go
        ├── new_server_test.go
        ├── utils.go
        ├── utils_test.go
        └── routes.go

4 directories, 17 files
# ./configs/apiserver.yml

# Server config
server:
    host: 0.0.0.0
    port: 5000

# Database config
database:
    host: 127.0.0.1
    port: 5432
    username: postgres
    password: 1234

# Static files config
static:
    prefix: /
    path: ./static

  1. If you've never heard of Taskfile, we recommend to read the Docs and use it, instead of Makefile