spa

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 4 Imported by: 0

README

Go SPA

Tiny Single Page Application server for Go with spa command-line tool.

Installation

To install the command-line tool:

$ curl -sf https://gobinaries.com/tj/spa/cmd/spa | sh

GoDoc

Sponsors

This project is sponsored by CTO.ai, making it easy for development teams to create and share workflow automations without leaving the command line.

And my GitHub sponsors:

Documentation

Overview

Package spa provides a Single Page Application server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Dir string
}

Server is an http.Handler which serves static files from Dir, and reverts to serving index.html for any missing files.

Requests which contain an extension — such as /favicon.ico — are greated as requests for a file, yielding 404 instead of serving /index.html.

func (Server) ServeHTTP

func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implementation.

Directories

Path Synopsis
cmd
spa

Jump to

Keyboard shortcuts

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