Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught ReferenceError: webserver is not defined #40

Open
pr46 opened this issue Jul 31, 2019 · 2 comments
Open

Uncaught ReferenceError: webserver is not defined #40

pr46 opened this issue Jul 31, 2019 · 2 comments

Comments

@pr46
Copy link

pr46 commented Jul 31, 2019

Hi
I'm tryng to use the plugin but i receive this error. I think it's an injection error, but i didn't see the injection variables name in documentation.
I put the code inside the deviceready event.
Can someone help Me?
thanks Paolo

`$ionicPlatform.ready(function() {

 webserver.onRequest(
function(request) {
	console.log("O MA GAWD! This is the request: ", request);

	webserver.sendResponse(
		request.requestId,
		{
			status: 200,
			body: '<html>Hello World</html>',
			headers: {
				'Content-Type': 'text/html'
			}
		}
	);
}

);

webserver.start(function(){console.log("it's working");});
});`

@EmadFani
Copy link

same here any news ?

@shangzhenyang
Copy link

I solved this by adding <script src="cordova.js"></script> into the HTML file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants