Metrics
0
Watch 25 Star 79 Fork 18

codeskyblue / gohttpserverGoMIT

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
The best HTTP Static File Server, write with golang spread retract

Clone or download
res_nobindata.go 445 Bytes
Copy Edit Web IDE Raw Blame History
codeskyblue authored 2016-07-30 09:31 . fix tests
// +build !bindata
package main
import (
"io/ioutil"
"log"
"net/http"
)
func init() {
//selfDir := filepath.Dir(os.Args[0])
//resDir := filepath.Join(selfDir, "./res")
resDir := "./res"
http.Handle("/-/res/", http.StripPrefix("/-/res/", http.FileServer(http.Dir(resDir))))
for name, path := range templates {
content, err := ioutil.ReadFile(path)
if err != nil {
log.Fatal(err)
}
ParseTemplate(name, string(content))
}
}

Comment ( 0 )

You need to Sign in for post a comment

Help Search

183227_9af5e6a8_1826025 111910_4d91f001_1826025