2022-11-25 13:33:27 -05:00
|
|
|
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"
|
2022-11-25 15:22:20 -05:00
|
|
|
"git.metaunix.net/BitGoblin/colossus/routes"
|
2022-11-25 13:33:27 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-11-25 15:13:32 -05:00
|
|
|
// initialize database connection
|
|
|
|
models.InitDB()
|
|
|
|
|
|
|
|
// start initialize Flamego router
|
2022-11-25 13:33:27 -05:00
|
|
|
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
|
2022-11-25 15:22:20 -05:00
|
|
|
routes.InitRoutes(f)
|
2022-11-25 14:00:28 -05:00
|
|
|
|
2022-11-25 13:33:27 -05:00
|
|
|
f.Run()
|
|
|
|
}
|