Plugin XML settings
This commit is contained in:
parent
fb261d6c67
commit
ac5b47b1a0
@ -21,7 +21,7 @@
|
||||
<source-file src="src/android/NanoHTTPDWebserver.java" target-dir="src/org/apache/cordova/plugin"/>
|
||||
<config-file target="config.xml" parent="/*">
|
||||
<feature name="Webserver">
|
||||
<param name="android-package" value="Webserver"/>
|
||||
<param name="android-package" value="org.apache.cordova.plugin.Webserver"/>
|
||||
</feature>
|
||||
</config-file>
|
||||
</platform>
|
||||
|
@ -1,4 +1,3 @@
|
||||
cordova.define("cordova-plugin-webserver-tests.tests", function(require, exports, module) {
|
||||
exports.defineAutoTests = function() {
|
||||
|
||||
describe('Webserver (window.webserver)', function () {
|
||||
@ -91,5 +90,3 @@ exports.defineManualTests = function(contentEl, createActionButton) {
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
23
webserver.js
23
webserver.js
@ -1,7 +1,6 @@
|
||||
cordova.define("cordova-plugin-webserver.webserver", function(require, exports, module) {
|
||||
var WEBSERVER_CLASS = "Webserver";
|
||||
var WEBSERVER_CLASS = "Webserver";
|
||||
|
||||
exports.start = function(success_callback, error_callback, port) {
|
||||
exports.start = function(success_callback, error_callback, port) {
|
||||
cordova.exec(
|
||||
success_callback,
|
||||
error_callback,
|
||||
@ -9,9 +8,9 @@ cordova.define("cordova-plugin-webserver.webserver", function(require, exports,
|
||||
"start",
|
||||
[port]
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
exports.onRequest = function(success_callback) {
|
||||
exports.onRequest = function(success_callback) {
|
||||
cordova.exec(
|
||||
success_callback,
|
||||
function(error) {console.error(error)},
|
||||
@ -19,14 +18,14 @@ cordova.define("cordova-plugin-webserver.webserver", function(require, exports,
|
||||
"onRequest",
|
||||
[]
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
exports.sendResponse = function(
|
||||
exports.sendResponse = function(
|
||||
requestId,
|
||||
params,
|
||||
success_callback,
|
||||
error_callback
|
||||
) {
|
||||
) {
|
||||
cordova.exec(
|
||||
success_callback,
|
||||
error_callback,
|
||||
@ -34,9 +33,9 @@ cordova.define("cordova-plugin-webserver.webserver", function(require, exports,
|
||||
"sendResponse",
|
||||
[requestId, params]
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
exports.stop = function(success_callback, error_callback) {
|
||||
exports.stop = function(success_callback, error_callback) {
|
||||
cordova.exec(
|
||||
success_callback,
|
||||
error_callback,
|
||||
@ -44,6 +43,4 @@ cordova.define("cordova-plugin-webserver.webserver", function(require, exports,
|
||||
"stop",
|
||||
[]
|
||||
);
|
||||
};
|
||||
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user