package main import ( "fmt" "html" "log" "net/http" "strconv" router "./core/router" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { router.Add(`\/(.*)`, func(w http.ResponseWriter, r *http.Request, vars []string) { fmt.Println(vars) fmt.Fprintf(w, "Hello Route, %q", html.EscapeString(r.URL.Path)) }) router.Match(w, r) }) log.Fatal(http.ListenAndServe(":"+strconv.Itoa(SERVER_PORT), nil)) }