web

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// WebMaxHeaderBytes is the largest number of header bytes accepted by
	// the webserver
	WebMaxHeaderBytes int = 1 << 17 // ~125k

	// ServerAddress is the default Server network address
	ServerAddress string = "127.0.0.1"

	// ServerPort is the default Server network port
	ServerPort string = "8000"

	// BaseURL is the base url for redirects, etc.
	BaseURL string = ""
)
View Source
var (
	DirFS *fileSystem
)

development flags and static and template directory locations

View Source
var StaticFS embed.FS

Functions

func Favicon

func Favicon(w http.ResponseWriter, r *http.Request)

Favicon serves up the favicon

func Health

func Health(w http.ResponseWriter, r *http.Request)

HealthCheck shows if the service is up

func Home

func Home(w http.ResponseWriter, r *http.Request)

Home is the home page

func NewFileSystem

func NewFileSystem(inDevelopment bool, tplDirPath, staticDirPath string) (*fileSystem, error)

NewFileSystem returns a new fileSystem

func Results

func Results(w http.ResponseWriter, r *http.Request)

Results shows the results of a "search" form submission in an htmx partial

func Serve

func Serve(addr, port string)

Serve runs the web server on the specified address and port

func SetupFS

func SetupFS() error

SetupFS setup the filesystem for templates or static files, depending on development (filesystem) or not (embedded)

Types

This section is empty.

Jump to

Keyboard shortcuts

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