enhancedfileserver/example/main.go

17 lines
340 B
Go

package main
import (
"gitto.work/shortcut/enhancedfileserver"
"log"
"net/http"
"os"
)
/* Most simple example of using enhanced-file-server package. Will serve from the current directory on port 12345 */
func main() {
dir, err := os.Getwd()
log.Fatal(http.ListenAndServe(":12345", enhancedfileserver.FileServer(http.Dir(dir))))
}