x10-remote
Version:
X10 Home Automation Server
15 lines (13 loc) • 371 B
JavaScript
function route(handle, pathname, response, request) {
if (typeof handle[pathname] === 'function') {
handle[pathname](response, request);
} else {
console.log("No request handler found for " + pathname);
response.writeHead(404, {
"Content-Type" : "text/html"
});
response.write("404 Not found");
response.end();
}
}
exports.route = route;