30 lines
600 B
Go
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)
|
|
}
|