Skip to content

A Go Fiber web server with graceful exit, structured logging, environment variable configuration, and local development.

License

Notifications You must be signed in to change notification settings

flexstack-apps/fiber-server

Repository files navigation

Go Fiber boilerplate

A Go Fiber web server with graceful exit, structured logging, environment variable configuration, and local development tooling.

Deploying

The easiest way to deploy your Go Fiber server to AWS is to use the FlexStack Serverless Platform.

Deploy on FlexStack

Local development

Quick start

See Prerequisites for installing mise – an all-in-one tool for managing project dependencies, environment variables, and running tasks.

# Setup the project
mise run setup

# Start the development server
# By default: https://localhost:3000
mise run

Development scripts

  • To see a list of development scripts, run mise tasks.
  • To run a script, run mise run <script-name>.

VS Code and Cursor

If you're using VS Code or Cursor as your editor, we recommend the following extensions:

We also recommend the following settings in your .vscode/settings.json:

{
	"editor.defaultFormatter": "dprint.dprint",
	"editor.formatOnSave": true,
	"[go]": {
		"editor.defaultFormatter": "dprint.dprint"
	},
	"[json]": {
		"editor.defaultFormatter": "dprint.dprint"
	},
	"[jsonc]": {
		"editor.defaultFormatter": "dprint.dprint"
	},
	"[yaml]": {
		"editor.defaultFormatter": "dprint.dprint"
	},
	"[toml]": {
		"editor.defaultFormatter": "dprint.dprint"
	},
	"[markdown]": {
		"editor.defaultFormatter": "dprint.dprint"
	},
	"[dockerfile]": {
		"editor.defaultFormatter": "dprint.dprint"
	}
}

Prerequisites

We use mise to run tasks, manage tool versions, and manage environment variables.

  1. Install mise
curl https://mise.run | sh
  1. Add mise to your shell profile. This activates mise in your shell, ensuring the correct tool versions are used for your environment.
# Zsh
echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc
echo 'eval "$(~/.local/bin/mise activate zsh --shims)"' >> ~/.zprofile
source ~/.zshrc

# Bash 
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
echo 'eval "$(~/.local/bin/mise activate bash --shims)"' >> ~/.bash_profile
source ~/.bashrc

# Fish
echo '~/.local/bin/mise activate fish | source' >> ~/.config/fish/config.fish
fish_add_path ~/.local/share/
  1. Run mise trust to trust the project's .mise.toml file.

About

A Go Fiber web server with graceful exit, structured logging, environment variable configuration, and local development.

Topics

Resources

License

Stars

Watchers

Forks

Languages