Documentation ¶
Overview ¶
Package sorvor is an extremely fast, zero config ServeIndex for modern web applications.
Index ¶
- type BuildCache
- type Sorvor
- func (serv *Sorvor) BuildEntry(entry string) ([]string, api.BuildResult)
- func (serv *Sorvor) BuildIndex(pkg *pkgjson.PkgJSON, cache BuildCache) []string
- func (serv *Sorvor) RunEntry(entry string)
- func (serv *Sorvor) ServeHTTP(res http.ResponseWriter, request *http.Request)
- func (serv *Sorvor) ServeIndex(pkg *pkgjson.PkgJSON)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildCache ¶ added in v0.4.5
type BuildCache map[string]api.OutputFile
type Sorvor ¶
type Sorvor struct { BuildOptions api.BuildOptions Entry string Host string Port string Serve bool Secure bool Pkg *pkgjson.PkgJSON }
Sorvor struct
func (*Sorvor) BuildEntry ¶
func (serv *Sorvor) BuildEntry(entry string) ([]string, api.BuildResult)
BuildEntry builds a given entrypoint using esbuild
func (*Sorvor) BuildIndex ¶
func (serv *Sorvor) BuildIndex(pkg *pkgjson.PkgJSON, cache BuildCache) []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 ¶
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 ¶
ServeIndex launches esbuild in watch mode and live reloads all connected browsers
Click to show internal directories.
Click to hide internal directories.