fiber

command module
v0.0.0-...-a481549 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 1 Imported by: 0

README

Introduction

This project is used to quickly create a project based on the Fiber framework and presets some basic configurations.

Download template locally with gonew

Install gonew if you have not already.

go install golang.org/x/tools/cmd/gonew@latest

Download this template locally:

gonew github.com/betterde/template/fiber your.domain/module

Config

env: production

http:
  listen: 0.0.0.0:8443
  tlsKey: /certs/domain.tld.key
  tlsCert: /certs/domain.tld.crt
logging:
  level: ERROR

Environment

PREFIX=
# General configration
${PREFIX}_ENV=production
${PREFIX}_LOGGING_LEVEL=INFO

# API configuration
${PREFIX}_HTTP_LISTEN=0.0.0.0:443

# TLS File provider
${PREFIX}_HTTP_TLSKEY=/certs/domain.tld.key
${PREFIX}_HTTP_TLSCERT=/certs/domain.tld.crt

Frontend

Initialize your project in the spa directory, configure the project to be packaged and output to the spa/dist directory, and then uncomment lines 30 to 35 in the api/routes/register.go file:

app.Get("*", filesystem.New(filesystem.Config{
	Root:               spa.Serve(),
	Index:              "index.html",
	NotFoundFile:       "index.html",
	ContentTypeCharset: "UTF-8",
})).Name("SPA static resource")

Documentation

Overview

Copyright © 2024 George <george@betterde.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
api
internal
pkg
api

Jump to

Keyboard shortcuts

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