go-sample-webpage/main.go
kekskurse 4f5226a2e5
All checks were successful
continuous-integration/drone/push Build is passing
Pipeline
2021-11-09 12:30:28 +01:00

29 lines
582 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{
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)
}