aboutsummaryrefslogtreecommitdiff
path: root/cmd/galleryd/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/galleryd/main.go')
-rw-r--r--cmd/galleryd/main.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/cmd/galleryd/main.go b/cmd/galleryd/main.go
new file mode 100644
index 0000000..444ce34
--- /dev/null
+++ b/cmd/galleryd/main.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+ "context"
+ "log"
+ "os"
+ "os/signal"
+ "syscall"
+
+ "github.com/RanXom/galleryd/internal/api"
+)
+
+func main() {
+ ctx, stop := signal.NotifyContext(
+ context.Background(),
+ os.Interrupt,
+ syscall.SIGTERM,
+ )
+ defer stop()
+
+ server := api.New(api.Config{
+ Address: ":8082",
+ })
+
+ log.Println("galleryd listening on :8082")
+
+ if err := server.Run(ctx); err != nil {
+ log.Fatal(err)
+ }
+}