No Description

main.go 349B

123456789101112131415161718192021
  1. package main
  2. import (
  3. "fmt"
  4. "html"
  5. "log"
  6. "net/http"
  7. "strconv"
  8. router "./core/router"
  9. )
  10. func main() {
  11. http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
  12. router.Routes.Add("Url", "test")
  13. fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
  14. })
  15. log.Fatal(http.ListenAndServe(":"+strconv.Itoa(ServerPort), nil))
  16. }