Help us shape the future of Go! Take the 2026 Go Developer Survey

favicon

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 6 Imported by: 101

README

Favicon Gin's middleware

Gin middleware to support favicon.

Usage

Start using it

Download and install it:

$ go get github.com/thinkerou/favicon

Import it in your code:

import "github.com/thinkerou/favicon"
Canonical example:
package main
            
import (
    "github.com/gin-gonic/gin"
    "github.com/thinkerou/favicon"
)
            
func main() {
    r := gin.Default()
    r.Use(favicon.New("./favicon.ico")) // set favicon middleware 

    r.GET("/ping", func(c *gin.Context) {
        c.String(200, "Hello favicon.")
    })

    r.Run(":8080")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string) gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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