UNPKG

demos

Version:

14 lines (10 loc) 300 B
function dispatch(handle, path) { console.log("Dispatching the request from " + path); if (typeof handle[path] === 'function') { return handle[path](); } else { console.log("No request handler found for " + path); return "404 Not found"; } } exports.dispatch = dispatch;