Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koron/go-spafs
File server which specialized for SPA
https://github.com/koron/go-spafs
golang http spa
Last synced: 24 days ago
JSON representation
File server which specialized for SPA
- Host: GitHub
- URL: https://github.com/koron/go-spafs
- Owner: koron
- License: mit
- Created: 2017-07-13T06:51:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-14T04:32:46.000Z (over 7 years ago)
- Last Synced: 2024-10-04T10:53:17.932Z (about 1 month ago)
- Topics: golang, http, spa
- Language: Go
- Homepage: https://www.kaoriya.net/blog/2017/09/03/
- Size: 6.84 KB
- Stars: 11
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```console
go get -v -u github.com/koron/go-spafs
```Example code:
```go
package mainimport (
"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)
}
}
```