Documentation ¶
Overview ¶
Package sorvor is an extremely fast, zero config ServeIndex for modern web applications.
Index ¶
- type Sorvor
- func (serv *Sorvor) BuildEntry(entry string) (string, api.BuildResult)
- func (serv *Sorvor) BuildIndex(pkg *pkgjson.PkgJSON) []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 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
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
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
ServeIndex launches esbuild in watch mode and live reloads all connected browsers
Click to show internal directories.
Click to hide internal directories.