From 0007b69fdbbcf463eeb538c02dc191ccd6f62df9 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Mon, 9 Oct 2023 11:31:04 -0400 Subject: one --- main.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 main.go (limited to 'main.go') diff --git a/main.go b/main.go new file mode 100644 index 0000000..d32641e --- /dev/null +++ b/main.go @@ -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) + } +} -- cgit v1.2.3