From e21327cec59a3b7e8c7a6c3ef723ed6baeebf722 Mon Sep 17 00:00:00 2001 From: nimbleghost <132819643+nimbleghost@users.noreply.github.com> Date: Wed, 24 May 2023 12:24:34 +0200 Subject: [PATCH] Add vite Changes according to Vite defaults: - Move index.html to root - Replace `%PUBLIC_URL%` with plain `/` --- Makefile | 3 +- server/server_test.go | 2 +- web/{public => }/index.html | 11 +- web/package-lock.json | 15029 ++-------------------------------- web/package.json | 10 +- web/vite.config.js | 14 + 6 files changed, 527 insertions(+), 14542 deletions(-) rename web/{public => }/index.html (80%) create mode 100644 web/vite.config.js diff --git a/Makefile b/Makefile index cc571c16..73988446 100644 --- a/Makefile +++ b/Makefile @@ -129,8 +129,7 @@ web-build: && rm -rf ../server/site \ && mv build ../server/site \ && rm \ - ../server/site/config.js \ - ../server/site/asset-manifest.json + ../server/site/config.js web-deps: cd web && npm install diff --git a/server/server_test.go b/server/server_test.go index fe84b856..73df2762 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -219,7 +219,7 @@ func TestServer_StaticSites(t *testing.T) { rr = request(t, s, "GET", "/mytopic", "", nil) require.Equal(t, 200, rr.Code) - require.Contains(t, rr.Body.String(), ``) + require.Contains(t, rr.Body.String(), ``) rr = request(t, s, "GET", "/docs", "", nil) require.Equal(t, 301, rr.Code) diff --git a/web/public/index.html b/web/index.html similarity index 80% rename from web/public/index.html rename to web/index.html index e8c7f8a6..c146e64d 100644 --- a/web/public/index.html +++ b/web/index.html @@ -15,7 +15,7 @@ - + @@ -26,15 +26,15 @@ property="og:description" content="ntfy lets you send push notifications via scripts from any computer or phone. Made with ❤ by Philipp C. Heckel, Apache License 2.0, source at https://heckel.io/ntfy." /> - + - - + +
- + +