2017-06-25 16:11:25 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/hacdias/filemanager"
|
|
|
|
)
|
|
|
|
|
|
|
|
var m *filemanager.FileManager
|
|
|
|
|
|
|
|
func handler(w http.ResponseWriter, r *http.Request) {
|
|
|
|
_, err := m.ServeHTTP(w, r)
|
|
|
|
if err != nil {
|
|
|
|
log.Print(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
m = filemanager.New()
|
|
|
|
http.HandleFunc("/", handler)
|
|
|
|
http.ListenAndServe(":8080", nil)
|
2017-06-25 17:02:16 +08:00
|
|
|
}
|