Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(iconpath string) gear.Middleware
New creates a favicon middleware to serve favicon from the provided directory.
package main
import (
"github.com/teambition/gear"
"github.com/teambition/gear/middleware/favicon"
)
func main() {
app := gear.New()
app.Use(favicon.New("./testdata/favicon.ico"))
app.Use(func(ctx *gear.Context) error {
return ctx.HTML(200, "<h1>Hello, Gear!</h1>")
})
app.Error(app.Listen(":3000"))
}
func NewWithIco ¶ added in v0.19.0
func NewWithIco(file []byte, times ...time.Time) gear.Middleware
NewWithIco creates a favicon middleware with ico file and a optional modTime.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.