plugins/mod_http_errors.lua
changeset 10434 46dd9df2db0c
parent 9764 88640b3ea6b8
child 10578 f70c874b7936
--- a/plugins/mod_http_errors.lua	Sat Nov 23 17:15:34 2019 +0100
+++ b/plugins/mod_http_errors.lua	Sun Nov 17 16:16:53 2019 +0100
@@ -75,3 +75,15 @@
 	end
 	return get_page(event.code, (show_private and event.private_message) or event.message);
 end);
+
+module:hook_object_event(server, "http-error", function (event)
+	local request, response = event.request, event.response;
+	if request and response and request.path == "/" and response.status_code == 404 then
+		response.headers.content_type = "text/html; charset=utf-8";
+		return render(html, {
+				title = "Prosody is running!";
+				message = "Welcome to the XMPP world!";
+			});
+	end
+end, 1);
+