2023-06-01 16:34:41 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-07-03 09:38:34 +00:00
|
|
|
"cliffbreak.de/hgoe-sas-server/pkg/middlewares"
|
2023-06-05 16:05:25 +00:00
|
|
|
"cliffbreak.de/hgoe-sas-server/pkg/utils"
|
2023-06-01 16:34:41 +00:00
|
|
|
"github.com/pocketbase/pocketbase"
|
|
|
|
"github.com/pterm/pterm"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
pterm.Info.Println("Loading environment variables...")
|
|
|
|
utils.LoadEnv()
|
|
|
|
pterm.Info.Println("Starting PocketBase server...")
|
|
|
|
app := pocketbase.New()
|
|
|
|
|
2023-07-03 09:38:34 +00:00
|
|
|
app.OnBeforeServe().Add(middlewares.ServeSPA(utils.GetEnv("WEBAPP", "./webapp")))
|
|
|
|
|
2023-06-01 16:34:41 +00:00
|
|
|
if err := app.Start(); err != nil {
|
|
|
|
pterm.Fatal.Println(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|