server

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(sc ServeConfig)

func SendKillSignal

func SendKillSignal(slog *zap.SugaredLogger)

Types

type ProxyMiddleware

type ProxyMiddleware struct {
	Prefix       string `json:"prefix"`
	Target       string `json:"target"`
	ChangeOrigin bool   `json:"changeOrigin"`
	Secure       bool   `json:"secure"`
}

type ServeConfig

type ServeConfig struct {
	Port               uint   `json:"port"`
	Root               string `json:"root"`
	File               string `json:"file"`
	CORS               bool   `json:"cors"`
	HTTPS              bool   `json:"https"`
	HistoryApiFallback bool   `json:"historyApiFallback"`

	Proxy  []ProxyMiddleware `json:"proxy"`
	Server Server            `json:"server"`

	// TODO
	Host   string `json:"host"`
	IsYarn bool   `json:"isYarn"`

	// internal
	Internal          internalConfig `json:"-"`
	LocalAddress      string         `json:"-"`
	NetworkAddress    string         `json:"-"`
	HttpProtocol      string         `json:"-"`
	WebsocketProtocol string         `json:"-"`
}

type Server

type Server struct {
	// file name only, not path
	Cert string `json:"cert"`
	Key  string `json:"key"`

	// logger
	Debug bool `json:"debug"`
	Color bool `json:"color"`
}

Jump to

Keyboard shortcuts

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