static

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 11 Imported by: 0

README

Static Directory Plugin

This is an example plugin.

This plugin will serve / routes from a public directory, and optionally fallback to index.html.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StaticDirectoryHandler

func StaticDirectoryHandler(fileSystem fs.FS, indexFallback bool) echo.HandlerFunc

StaticDirectoryHandler is similar to `echo.StaticDirectoryHandler` but without the directory redirect which conflicts with RemoveTrailingSlash middleware.

If a file resource is missing and indexFallback is set, the request will be forwarded to the base index.html (useful also for SPA).

@see https://github.com/labstack/echo/issues/2211

Types

type Plugin

type Plugin struct{}

func (*Plugin) Info

func (p *Plugin) Info() xpb.PluginInfo

func (*Plugin) OnLoad

func (p *Plugin) OnLoad(app core.App) error

func (*Plugin) OnPreload

func (p *Plugin) OnPreload() error

Jump to

Keyboard shortcuts

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