1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Add hook to allow adding custom api endpoints to Express routing

This commit is contained in:
Martin Mädler 2023-01-27 12:23:10 +01:00
parent f5db131693
commit a8f89e1068
3 changed files with 132 additions and 101 deletions

View file

@ -6341,6 +6341,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
}
// Setup all HTTP handlers
if (parent.parent.pluginHandler != null) {
parent.parent.pluginHandler.callHook('hook_setupHttpHandlers', obj, parent);
}
if (parent.multiServer != null) { obj.app.ws('/meshserver.ashx', function (ws, req) { parent.multiServer.CreatePeerInServer(parent.multiServer, ws, req, obj.args.tlsoffload == null); }); }
for (var i in parent.config.domains) {
if ((parent.config.domains[i].dns != null) || (parent.config.domains[i].share != null)) { continue; } // This is a subdomain with a DNS name, no added HTTP bindings needed.