package main

import (
	"log"
	"net/http"
	"strconv"

	"./core/database"
	req "./core/request"
	res "./core/response"
	"./src/config"
)

func main() {

	database.Init()

	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		res.SetResponseWriter(w)
		req.SetRequest(r)
		config.Routes.Match(w, r)
	})

	log.Fatal(http.ListenAndServe(":"+strconv.Itoa(config.SERVER_PORT), nil))
}
