api/main.go

21 lines
359 B
Go
Raw Permalink Normal View History

2023-03-09 06:01:56 +00:00
package main
import (
"fmt"
"log"
"os"
"github.com/fasthttp/router"
"github.com/valyala/fasthttp"
_ "github.com/joho/godotenv/autoload"
"notashelf.dev/api/src/routes"
)
func main() {
r := router.New()
routes.InitRoutes(r)
port := os.Getenv("PORT")
fmt.Println("API on port: " + port)
log.Fatal(fasthttp.ListenAndServe(":" + port, r.Handler))
}