mirror of
https://github.com/bykof/cordova-plugin-webserver.git
synced 2026-04-20 00:02:45 +08:00
Starting server and stopping works.
Receiving receiving needs improvements
This commit is contained in:
@@ -16,12 +16,34 @@ exports.defineAutoTests = function() {
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
describe('Do a request', function() {
|
||||
|
||||
it('should do a request', function() {
|
||||
webserver.onRequest(
|
||||
function(request) {
|
||||
// Check for a request is made
|
||||
}
|
||||
);
|
||||
websever.start();
|
||||
webserver.stop();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
exports.defineManualTests = function(contentEl, createActionButton) {
|
||||
createActionButton('Start bljad Webserver', function() {
|
||||
console.log("Starting webserver...");
|
||||
|
||||
console.log(webserver);
|
||||
|
||||
webserver.onRequest(
|
||||
function(request) {
|
||||
console.log(request);
|
||||
webserver.sendResponse(request.requestId, {});
|
||||
}
|
||||
);
|
||||
|
||||
webserver.start(
|
||||
function() {
|
||||
console.log('Success!');
|
||||
|
||||
Reference in New Issue
Block a user