sorvor

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package sorvor is an extremely fast, zero config Server 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) Build

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

Build 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) Esbuild

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

Esbuild builds a given entrypoint using esbuild

func (*Sorvor) Run

func (serv *Sorvor) Run(entry string)

Run 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) Server

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

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

Jump to

Keyboard shortcuts

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