Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BindataAssets ¶
type BindataAssets struct { Prefix string // Prefix is prepended to the http file request Default string // Default is the file to serve if the file is not found DefaultContentType string // DefaultContentType is the content type of the default file }
BindataAssets serves assets from go-bindata, but, also serves Default if assent doesn't exist This is to support single-page react-apps with its own router.
func (*BindataAssets) Handler ¶
func (b *BindataAssets) Handler() http.Handler
Handler serves go-bindata using a go-bindata-assetfs façade
func (*BindataAssets) ServeHTTP ¶
func (b *BindataAssets) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP wraps http.FileServer by returning a default asset if the asset doesn't exist. This supports single-page react-apps with its own built-in router. Additionally, we override the content-type if the Default file is used.
type DebugAssets ¶
type DebugAssets struct { Dir string // Dir is a directory location of asset files Default string // Default is the file to serve if file is not found. }
DebugAssets serves assets via a specified directory
func (*DebugAssets) Handler ¶
func (d *DebugAssets) Handler() http.Handler
Handler is an http.FileServer for the Dir
Click to show internal directories.
Click to hide internal directories.