deadbeef.codes-publicfilese.../main.go
Steven Polley b97f1f37ec
Some checks are pending
continuous-integration/drone/push Build is passing
server at root - fixed
2019-01-05 20:58:40 -07:00

24 lines
408 B
Go

package main
import (
"fmt"
"log"
"net/http"
"os"
"os/signal"
)
// http server setup and routing
func main() {
stop := make(chan os.Signal, 1)
signal.Notify(stop, os.Interrupt)
go func() {
http.Handle("/", http.FileServer(http.Dir("public")))
log.Fatal(http.ListenAndServe(":8080", nil))
}()
log.Println("started public fileserver on 8080")
<-stop
fmt.Println("Shutting server down...")
}