暫無描述

main.go 404B

123456789101112131415161718192021222324252627
  1. package main
  2. import (
  3. "log"
  4. "net/http"
  5. "strconv"
  6. "./config"
  7. "./core/database"
  8. req "./core/request"
  9. res "./core/response"
  10. "./routes"
  11. )
  12. func main() {
  13. database.Init()
  14. http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
  15. res.SetResponseWriter(w)
  16. req.SetRequest(r)
  17. routes.Routes.Match(w, r)
  18. })
  19. log.Fatal(http.ListenAndServe(":"+strconv.Itoa(config.SERVER_PORT), nil))
  20. }