Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAPIRoutesHandler ¶
Types ¶
type SPAHandler ¶
SPAHandler implements the http.Handler interface. The path to the static directory and path to the index file within that static directory are used to serve the SPA in the given static directory.
func NewSinglePageApplicationHandler ¶
func NewSinglePageApplicationHandler(servingPath, appDir string) SPAHandler
func (SPAHandler) ServeHTTP ¶
func (h SPAHandler) 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
Click to show internal directories.
Click to hide internal directories.