cordova-plugin-webserver/webserver.js
2017-07-10 14:38:46 +02:00

50 lines
974 B
JavaScript

cordova.define("cordova-plugin-webserver.webserver", function(require, exports, module) {
var WEBSERVER_CLASS = "Webserver";
exports.start = function(success_callback, error_callback, port) {
cordova.exec(
success_callback,
error_callback,
WEBSERVER_CLASS,
"start",
[port]
);
};
exports.onRequest = function(success_callback) {
cordova.exec(
success_callback,
function(error) {console.error(error)},
WEBSERVER_CLASS,
"onRequest",
[]
);
};
exports.sendResponse = function(
requestId,
params,
success_callback,
error_callback
) {
cordova.exec(
success_callback,
error_callback,
WEBSERVER_CLASS,
"sendResponse",
[requestId, params]
);
};
exports.stop = function(success_callback, error_callback) {
cordova.exec(
success_callback,
error_callback,
WEBSERVER_CLASS,
"stop",
[]
);
};
});