No Description

main.go 396B

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