mirror of
https://github.com/fatedier/frp.git
synced 2026-03-24 00:48:31 +08:00
using glide
This commit is contained in:
11
vendor/github.com/rakyll/statik/example/README.md
generated
vendored
Normal file
11
vendor/github.com/rakyll/statik/example/README.md
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# How to run?
|
||||
|
||||
Run statik on the root of this example project to generate source code with directory contents.
|
||||
|
||||
$ statik
|
||||
|
||||
Once the <projectPath>/statik package is generated, run the web server:
|
||||
|
||||
$ go run main.go
|
||||
|
||||
Visit [http://localhost:8080/public/hello.txt](http://localhost:8080/public/hello.txt) to see the file.
|
||||
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)
|
||||
}
|
||||
2
vendor/github.com/rakyll/statik/example/public/hello.txt
generated
vendored
Normal file
2
vendor/github.com/rakyll/statik/example/public/hello.txt
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
Hello World
|
||||
|
||||
BIN
vendor/github.com/rakyll/statik/example/public/img/friends.jpg
generated
vendored
Normal file
BIN
vendor/github.com/rakyll/statik/example/public/img/friends.jpg
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
Reference in New Issue
Block a user