spa

package
v2.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 11 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, logger *log.Logger) (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     *log.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
}

Jump to

Keyboard shortcuts

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