router

package
v0.0.0-...-a7e6680 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSAccessControlAllowOrigin

func CORSAccessControlAllowOrigin(r *mux.Router) mux.MiddlewareFunc

func JwtAuthentication

func JwtAuthentication(next http.Handler, state *state.ServerState, registry map[string]routes.RouteEntry) http.Handler

Types

type Handlers

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

func NewHandlers

func NewHandlers(state *state.ServerState) *Handlers

NewHandlers void

func (*Handlers) ServeHTTP

func (h *Handlers) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP inspects the URL path to locate a file within the static dir on the SPA handler. If a file is found, it will be served. If not, the file located at the index path on the SPA handler will be served. This is suitable behavior for serving an SPA (single page application).

func (*Handlers) SetupRoutes

func (h *Handlers) SetupRoutes(router *mux.Router) error

SetupRoutes add home route to mux

func (*Handlers) WrapHandlerFunc

func (h *Handlers) WrapHandlerFunc(next routes.HandlerFunc) http.HandlerFunc

func (*Handlers) WrapMiddlewareFunc

func (h *Handlers) WrapMiddlewareFunc(next routes.MiddlewareFunc, registry map[string]routes.RouteEntry) mux.MiddlewareFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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