29 lines
683 B
Go
29 lines
683 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"git.keks.cloud/kekskurse/go-sample-webpage/pkg/sample"
|
|
"git.keks.cloud/kekskurse/go-sample-webpage/pkg/user"
|
|
"git.keks.cloud/kekskurse/go-sample-webpage/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, user.NewConfig())
|
|
},
|
|
}
|
|
|
|
webpage.RunWebApp(config)
|
|
}
|