Help us shape the future of Go! Take the 2026 Go Developer Survey

web

package
v0.0.0-...-cff19eb Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: AGPL-3.0, AGPL-3.0-only Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheControlImmutableAssets = "public, max-age=31536000, immutable" // 1 year
	CacheControlRootAssets      = "public, max-age=86400"               // 1 day
	CacheControlDocuments       = "no-cache, must-revalidate"
)

Variables

This section is empty.

Functions

func CreateApp

func CreateApp(maxBodyMB int, logger *zap.Logger, useColor bool) *fiber.App

func SetupDocsServing

func SetupDocsServing(app *fiber.App, docsFS fs.FS)

SetupDocsServing mounts the built guide before the app's SPA/dev proxy fallback. Documentation is public; missing pages and assets must not return the app shell.

func SetupStaticFileServing

func SetupStaticFileServing(app *fiber.App, devMode bool, vitePort int, webFS fs.FS) error

SetupStaticFileServing configures the Fiber app to serve static files. In dev mode, it proxies all requests to the Vite dev server (with an optional fallback to ./public). In production, it serves embedded static assets from the provided fs.FS, with support for user-provided assets in ./public that take precedence over embedded ones.

webFS should be an fs.FS containing the embedded frontend assets (if in prod mode)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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