spa

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIndexFilename = "index.html"

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(setting SPASettings, middlewares []negroni.Handler) (model.Router, error)

func NewSPAHandlerFunc

func NewSPAHandlerFunc(c SPASettings) http.HandlerFunc

NewSpaHandlerFunc returns new handle to serve SPA apps highly inspired by echo spa static server https://github.com/labstack/echo/blob/master/middleware/static.go#L164

Types

type Router

type Router struct {
	Logger     *slog.Logger
	Middleware *negroni.Negroni
	FS         http.FileSystem
}

login app router

func (*Router) ServeHTTP

func (ar *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements identifo.Router interface.

type SPAHandlerError

type SPAHandlerError struct {
	// contains filtered or unexported fields
}

func (SPAHandlerError) Error

func (e SPAHandlerError) Error() string

type SPASettings

type SPASettings struct {
	Name           string
	Root           string
	FileSystem     http.FileSystem
	Index          string
	LoggerSettings model.LoggerSettings
}

Jump to

Keyboard shortcuts

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