go-sample-webpage/main.go
2021-11-08 03:33:36 +01:00

30 lines
600 B
Go

package main
import (
"embed"
"gin-test/pkg/sample"
"gin-test/pkg/user"
"gin-test/pkg/webpage"
)
// content holds our static web server content.
//go:embed static/* templates/*
var webserver embed.FS
//go:embed database/migrations/*.sql
var migrationFS embed.FS
func main() {
config := webpage.WebPageConfig{
Commands: nil,
Templates: webserver,
Static: webserver,
Migrations: migrationFS,
Bootstrap: func(config webpage.BootstrapConfig) {
sample.Register(config.Router)
user.Register(config.Router, config.Token, config.UserClient)
},
}
webpage.RunWebApp(config)
}