sorvor

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package sorvor is an extremely fast, zero config ServeIndex for modern web applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sorvor

type Sorvor struct {
	BuildOptions api.BuildOptions
	Entry        string
	Host         string
	Port         string
	Serve        bool
	Secure       bool
}

Sorvor struct

func (*Sorvor) BuildEntry added in v0.3.3

func (serv *Sorvor) BuildEntry(entry string) (string, api.BuildResult)

BuildEntry builds a given entrypoint using esbuild

func (*Sorvor) BuildIndex added in v0.3.3

func (serv *Sorvor) BuildIndex(pkg *pkgjson.PkgJSON) []string

BuildIndex walks the index.html, collect all the entries from <script...></script> and <link .../> tags it then runs it through esbuild and replaces the references in index.html with new paths

func (*Sorvor) RunEntry added in v0.3.3

func (serv *Sorvor) RunEntry(entry string)

RunEntry builds an entrypoint and launches the resulting built file using node.js

func (*Sorvor) ServeHTTP

func (serv *Sorvor) ServeHTTP(res http.ResponseWriter, request *http.Request)

ServeHTTP is an http server handler for sorvor

func (*Sorvor) ServeIndex added in v0.3.3

func (serv *Sorvor) ServeIndex(pkg *pkgjson.PkgJSON)

ServeIndex launches esbuild in watch mode and live reloads all connected browsers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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