diff --git a/garden-app/server/api.go b/garden-app/server/api.go index 4b94b50f..61f9f9a4 100644 --- a/garden-app/server/api.go +++ b/garden-app/server/api.go @@ -48,6 +48,14 @@ func NewAPI() *API { api.API. AddCustomRoute(http.MethodGet, "/metrics", promhttp.Handler()). AddCustomRoute(http.MethodGet, "/", http.RedirectHandler("/gardens", http.StatusFound)). + AddCustomRoute(http.MethodGet, "/manifest.json", http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + // manifest.json enables PWA for mobile devices + _, _ = w.Write([]byte(`{ + "name": "Garden App", + "start_url": "/gardens", + "display": "standalone" + }`)) + })). AddNestedAPI(api.gardens). AddNestedAPI(api.weatherClients). AddNestedAPI(api.notificationClients). diff --git a/garden-app/server/templates/base.html b/garden-app/server/templates/base.html index 593209d9..6eac06ea 100644 --- a/garden-app/server/templates/base.html +++ b/garden-app/server/templates/base.html @@ -6,6 +6,7 @@