live

package module
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 8 Imported by: 0

README

echo-live

echo middleware that provide livereload feature

Usage

package main

import (
	"net/http"

	"github.com/labstack/echo/v4"
	"github.com/labstack/echo/v4/middleware"
	"github.com/mattn/echo-live"
)

func main() {
	e := echo.New()
	e.GET("/", func(c echo.Context) error {
		return c.String(http.StatusOK, "")
	})
	e.Use(middleware.Static("assets"))
	e.Use(live.Live())
	e.Logger.Fatal(e.Start(":8989"))
}

Thanks

echo-live is based off the echo-livereload library by Yasuhiro Matsumoto (a.k.a. mattn)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLiveConfig = LiveConfig{
		Skipper: middleware.DefaultSkipper,
		Name:    os.Args[0],
		Dir:     "assets",
	}
)

Functions

func Live

func Live() echo.MiddlewareFunc

func LiveWithConfig

func LiveWithConfig(config LiveConfig) echo.MiddlewareFunc

Types

type LiveConfig

type LiveConfig struct {
	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper

	Name string
	Dir  string
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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