2021-11-03 01:10:36 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"embed"
|
2021-11-09 11:34:25 +00:00
|
|
|
"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"
|
2021-11-03 01:10:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// content holds our static web server content.
|
|
|
|
//go:embed static/* templates/*
|
|
|
|
var webserver embed.FS
|
|
|
|
|
2021-11-08 01:25:36 +00:00
|
|
|
//go:embed database/migrations/*.sql
|
|
|
|
var migrationFS embed.FS
|
2021-11-03 01:10:36 +00:00
|
|
|
|
|
|
|
func main() {
|
2021-11-08 02:33:36 +00:00
|
|
|
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)
|
2021-11-08 01:25:36 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-11-08 02:33:36 +00:00
|
|
|
webpage.RunWebApp(config)
|
2021-11-08 01:25:36 +00:00
|
|
|
}
|