Mercurial > prosody-modules
comparison mod_conversejs/mod_conversejs.lua @ 6171:fe8222112cf4
mod_conversejs: Serve base app at /
This makes things slightly less awkward for the browser to figure out which
URLs belong to a PWA. The app's "start URL" was previously without the '/' and
therefore was not considered within the scope of the PWA. Now the canonical
app URL will always have a '/'.
Prosody/mod_http should take care of redirecting existing links without the
trailing / to the new URL.
If you have an installation at https://prosody/conversejs then it is now at
https://prosody/conversejs/ (the first URL will now redirect to the second
URL if you use it).
The alternative would be to make the PWA scope include the parent, i.e.
the whole of https://prosody/ in this case. This might get messy if other
PWAs are provided by the same site or Prosody installation, however.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 11 Feb 2025 13:18:38 +0000 |
| parents | 1c8197075d04 |
| children | 767b8594fb9d |
comparison
equal
deleted
inserted
replaced
| 6170:7205e0348bbe | 6171:fe8222112cf4 |
|---|---|
| 124 local pwa_color = module:get_option_string("pwa_color", "#397491") | 124 local pwa_color = module:get_option_string("pwa_color", "#397491") |
| 125 | 125 |
| 126 module:provides("http", { | 126 module:provides("http", { |
| 127 title = "Converse.js"; | 127 title = "Converse.js"; |
| 128 route = { | 128 route = { |
| 129 GET = function (event) | 129 ["GET /"] = function (event) |
| 130 local converse_options = get_converse_options(); | 130 local converse_options = get_converse_options(); |
| 131 | 131 |
| 132 event.response.headers.content_type = "text/html"; | 132 event.response.headers.content_type = "text/html"; |
| 133 return render(html_template, { | 133 return render(html_template, { |
| 134 service_name = service_name; | 134 service_name = service_name; |
| 173 { | 173 { |
| 174 src = cdn_url..version.."/dist/images/logo/conversejs-filled-512.svg", | 174 src = cdn_url..version.."/dist/images/logo/conversejs-filled-512.svg", |
| 175 sizes = "512x512", | 175 sizes = "512x512", |
| 176 }, | 176 }, |
| 177 }), | 177 }), |
| 178 start_url = module:http_url(), | 178 start_url = module:http_url().."/", |
| 179 background_color = pwa_color, | 179 background_color = pwa_color, |
| 180 display = "standalone", | 180 display = "standalone", |
| 181 scope = module:http_url().."/", | 181 scope = module:http_url().."/", |
| 182 theme_color = pwa_color, | 182 theme_color = pwa_color, |
| 183 } | 183 } |
