mirror of
https://github.com/fatedier/frp.git
synced 2026-03-23 16:38:23 +08:00
using glide
This commit is contained in:
22
vendor/github.com/rakyll/statik/example/main.go
generated
vendored
Normal file
22
vendor/github.com/rakyll/statik/example/main.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
_ "github.com/rakyll/statik/example/statik"
|
||||
"github.com/rakyll/statik/fs"
|
||||
)
|
||||
|
||||
// Before buildling, run `statik -src=./public`
|
||||
// to generate the statik package.
|
||||
// Then, run the main program and visit http://localhost:8080/public/hello.txt
|
||||
func main() {
|
||||
statikFS, err := fs.New()
|
||||
if err != nil {
|
||||
log.Fatalf(err.Error())
|
||||
}
|
||||
|
||||
http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(statikFS)))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
Reference in New Issue
Block a user