Skip to content

koron/go-spafs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPA Specialized File Server

spafs is a file server which specialized for SPA (single page application). This serves content of index.html in nearest ancestral directory for unavailable path.

How to use

Install and update:

go get -v -u github.com/koron/go-spafs

Example code:

package main

import (
    "http"
    spafs "github.com/koron/go-spafs"
)

func main() {
    fs := spafs.FileServer(http.Dir("./testdata"))
    err := http.ListenAndServe(":8080", fs)
    if err != nil {
        panic(err)
    }
}

About

File server which specialized for SPA

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages