route

package
v0.0.0-...-8a6d2ef Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(r *mux.Router, basePath string, h http.Handler)

Download mounts the websocket handler on the router

func Engine

func Engine(r *mux.Router, basePath string, engine http.Handler)

Engine mounts the websocket handler on the router

func Index

func Index(r *mux.Router, pathPrefix string, c Config) error

Index mounts serving of index.html on a path prefix. It uses a prefix since reloads of a page should give serving of the index.html page with the same url for the javascript frontend.

func Redirect

func Redirect(r *mux.Router, c Config)

Redirect mounts a redirect handler for a proxy on the router

func Static

func Static(r *mux.Router)

Static serves static files

Types

type Config

type Config struct {
	// RootPath is defined for changing the root path of serving. This is useful
	// if the server is behind a proxy that changes the root path.
	RootPath string `json:"root_path"`
	// BasePath is to change the base path after the root path.
	// It is used for dynamic mode where we have different locations for the index page.
	BasePath string `json:"base_path"`
}

Jump to

Keyboard shortcuts

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