mirror of
https://github.com/bykof/cordova-plugin-webserver.git
synced 2026-04-20 00:02:45 +08:00
Make server start and stop (start on a default or given port)
This commit is contained in:
+28
-2
@@ -19,8 +19,21 @@ exports.defineAutoTests = function() {
|
||||
};
|
||||
|
||||
exports.defineManualTests = function(contentEl, createActionButton) {
|
||||
createActionButton('Start Webserver', function() {
|
||||
console.log(webserver);
|
||||
createActionButton('Start bljad Webserver', function() {
|
||||
console.log("Starting webserver...");
|
||||
|
||||
webserver.start(
|
||||
function() {
|
||||
console.log('Success!');
|
||||
},
|
||||
function() {
|
||||
console.log('Error!');
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
createActionButton('Start Webserver with Port 1337', function() {
|
||||
console.log("Starting webserver...");
|
||||
|
||||
webserver.start(
|
||||
function() {
|
||||
@@ -29,7 +42,20 @@ exports.defineManualTests = function(contentEl, createActionButton) {
|
||||
function() {
|
||||
console.log('Error!');
|
||||
},
|
||||
1337
|
||||
);
|
||||
});
|
||||
|
||||
createActionButton('Stop Webserver', function() {
|
||||
console.log("Stopping webserver...");
|
||||
|
||||
webserver.stop(
|
||||
function() {
|
||||
console.log('Success!');
|
||||
},
|
||||
function() {
|
||||
console.log('Error!');
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user