mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
24 lines
341 B
Go
24 lines
341 B
Go
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)
|
|
}
|