aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2023-10-09 15:31:04 +0000
committerterminaldweller <devi@terminaldweller.com>2023-10-09 15:31:04 +0000
commit0007b69fdbbcf463eeb538c02dc191ccd6f62df9 (patch)
tree87f1c31a0730b995abfc49291906cb9e6c8711d7 /main.go
parentInitial commit (diff)
downloadsms-webhook-0007b69fdbbcf463eeb538c02dc191ccd6f62df9.tar.gz
sms-webhook-0007b69fdbbcf463eeb538c02dc191ccd6f62df9.zip
onedev
Diffstat (limited to 'main.go')
-rw-r--r--main.go22
1 files changed, 22 insertions, 0 deletions
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)
+ }
+}