colossus/colossus.go

35 lines
621 B
Go
Raw Normal View History

package main
import (
"github.com/flamego/flamego"
"github.com/flamego/template"
2022-11-25 15:13:32 -05:00
"git.metaunix.net/BitGoblin/colossus/models"
"git.metaunix.net/BitGoblin/colossus/routes"
)
func main() {
2022-11-25 15:13:32 -05:00
// initialize database connection
models.InitDB()
// start initialize Flamego router
f := flamego.Classic()
// serve static files from ./public/
f.Use(flamego.Static(
flamego.StaticOptions{
Directory: "public",
},
))
// initialize template engine
f.Use(template.Templater(template.Options{
Directory: "./views",
}))
// register route handlers
routes.InitRoutes(f)
f.Run()
}