knowyt/server/knyt.go
2021-07-30 16:16:55 +02:00

28 lines
532 B
Go

package main
import (
"fmt"
"net/http"
"sirlab.de/go/knyt/engine"
"sirlab.de/go/knyt/handler"
)
func main() {
app := handler.NewAuthMux()
http.Handle("/", app)
app.PublicHandleFunc("/__intern__/exit", handler.Exit)
// default handler
fsHandler := http.FileServer(http.Dir("../client/dist/"))
app.PublicHandle("/", fsHandler)
eng := engine.NewEngine()
app.PublicHandleFunc("/sync", eng.GetHttpHandler())
go eng.Run()
// start listening
fmt.Println("http://localhost:32039")
http.ListenAndServe(":32039", nil)
}