Mercurial > prosody-modules
comparison mod_conversejs/mod_conversejs.lua @ 3314:ab67f222d88b
mod_conversejs: Add an endpoint returning only initialization snippet
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 10 Sep 2018 15:08:09 +0200 |
| parents | d6b922191aeb |
| children | 2cf82cad1910 |
comparison
equal
deleted
inserted
replaced
| 3313:d6b922191aeb | 3314:ab67f222d88b |
|---|---|
| 74 local converse_options = get_converse_options(); | 74 local converse_options = get_converse_options(); |
| 75 | 75 |
| 76 event.response.headers.content_type = "text/html"; | 76 event.response.headers.content_type = "text/html"; |
| 77 return html_template:format(js_template:format(json_encode(converse_options))); | 77 return html_template:format(js_template:format(json_encode(converse_options))); |
| 78 end; | 78 end; |
| 79 | |
| 80 ["GET /prosody-converse.js"] = function (event) | |
| 81 local converse_options = get_converse_options(); | |
| 82 | |
| 83 event.response.headers.content_type = "application/javascript"; | |
| 84 return js_template:format(json_encode(converse_options)); | |
| 85 end; | |
| 79 } | 86 } |
| 80 }); | 87 }); |
| 81 | 88 |
