WebInterface reference implementation

This commit is contained in:
KimLS
2017-01-11 23:19:00 -08:00
parent 124728e0c7
commit f24770489e
15 changed files with 449 additions and 32 deletions
+22
View File
@@ -0,0 +1,22 @@
function Register(name, wsi, api) {
wsi.Register(name,
function(request) {
api.Call(name, request.params)
.then(function(value) {
wsi.Send(request, value);
})
.catch(function(reason) {
wsi.SendError(request, reason);
});
}, true);
}
var RegisterEQW = function(wsi, api) {
Register('EQW::IsLocked', wsi, api);
Register('EQW::Lock', wsi, api);
Register('EQW::Unlock', wsi, api);
};
module.exports = {
'Register': RegisterEQW
}