Closed AntonERG closed 4 years ago
You cannot import webserver, because the object gets injected by cordova. You can ignore the global variable by eslint:
/*global webserver */
@bykof thanks for quick reply! Actually, that wasn't related with your plugin, but with using cordova plugins in Vuejs. Just in case anybody will use it with vue, what was working for me:
Adding to index.templete.html:
<script src="cordova.js"></script>
Call webserver methods with window, e.g.:
window.webserver.onRequest()
window.webserver.sendResponce()
window.webserver.start()
Hi, I'm trying to add your solution to my Vuejs cordova project, but getting the error from eslint: 'webserver' is not defined It marks in red 'webserver' in the code, when I'm calling: webserver.onRequest() webserver.sendResponce() wenserver.start()
How to define 'webserver' in the project? From which file should I import it?