mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 09:38:51 +02:00
27 lines
498 B
Go
27 lines
498 B
Go
package main
|
|
|
|
import (
|
|
"github.com/pocketbase/pocketbase"
|
|
"github.com/pocketbase/pocketbase/apis"
|
|
"github.com/pocketbase/pocketbase/core"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
app := pocketbase.New()
|
|
|
|
addRoutes(app)
|
|
|
|
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
|
// serves static files from the provided public dir (if exists)
|
|
e.Router.GET("/*", apis.StaticDirectoryHandler(os.DirFS("./pb_public"), false))
|
|
|
|
return nil
|
|
})
|
|
|
|
if err := app.Start(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|