35 lines
621 B
Go
35 lines
621 B
Go
package main
|
|
|
|
import (
|
|
"github.com/flamego/flamego"
|
|
"github.com/flamego/template"
|
|
|
|
"git.metaunix.net/BitGoblin/colossus/models"
|
|
"git.metaunix.net/BitGoblin/colossus/routes"
|
|
)
|
|
|
|
func main() {
|
|
// 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()
|
|
}
|