hotweb

package
v0.0.0-...-b2d581b Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultWatchInterval = time.Millisecond * 100
)

Variables

View Source
var (
	InternalPath = "/.hotweb"
	ReloadExport = "noHMR"
)
View Source
var ClientFilename = "client.mjs"
View Source
var ClientSourceTmpl = `` /* 2505-byte string literal not displayed */
View Source
var ModuleProxyTmpl = `` /* 400-byte string literal not displayed */

Functions

This section is empty.

Types

type Config

type Config struct {
	Filesystem    afero.Fs
	ServeRoot     string // abs path in filesystem to serve
	Prefix        string // optional http path prefix
	JsxFactory    string
	InternalPath  string
	ReloadExport  string
	WatchInterval time.Duration
	IgnoreDirs    []string
}

type Handler

type Handler struct {
	Fs            *makefs.Fs
	ServeRoot     string
	Prefix        string
	IgnoreDirs    []string
	WatchInterval time.Duration

	Upgrader websocket.Upgrader
	Watcher  *watcher.Watcher
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *Handler

func (*Handler) MatchHTTP

func (m *Handler) MatchHTTP(r *http.Request) bool

func (*Handler) ServeHTTP

func (m *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) Watch

func (m *Handler) Watch() error

Jump to

Keyboard shortcuts

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