diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +package main + +import ( + "log" + "os" + + "github.com/pocketbase/pocketbase" + "github.com/pocketbase/pocketbase/apis" + "github.com/pocketbase/pocketbase/core" +) + +func main() { + app := pocketbase.New() + app.OnBeforeServe().Add(func(e *core.ServeEvent) error { + e.Router.GET("/*", apis.StaticDirectoryHandler(os.DirFS("./pb_public"), false)) + return nil + }) + + if err := app.Start(); err != nil { + log.Fatal(err) + } +} |