Comments (10)
Hi!
It seems that I will have to return to my project where I used this plugin. So, it is possible that I will make some more digging :}}
@samuelsont
I don't think there is a www root folder. This server is not like Apache2 or Nginx or ExpressJS. It can't serve static folders. You have to handle the request inside the onRequest method and use the request parameter to get more informations like: request method, url endpoint, query parameters, headers, body. Based on those parameters you can implement serving content from a specific folder.
The port is specified by you when you start the server. The IP will be you device's IP, if you are connected to a WiFi. If you are on mobile network the IP depends on you provider, whether they provide you a private or public IP (I doubt it will be public).
from cordova-plugin-webserver.
Holy... this sounds like a real problem.
I couldn't imagine how to do a workaround... since its included by default, as you said it.
My project was build first with plain cordova, but it seems that a lot of people use ionic more than the plain cordova stack...
from cordova-plugin-webserver.
@kukukk I get the same problem. could you tell me how did you do to start a webserver? The js Embedded in my ionic app sends http request with http://localhost:8100. when I start a webserver with port 8100, it failed. when I start a webserver with 1111, it success,but doesnot perform "webserver.onRequest" . Could you help me ? Thank you.
from cordova-plugin-webserver.
@waidp521: Since you are able to build your project you have a different problem.
from cordova-plugin-webserver.
Has this issue been fixed yet?? I also need to use this plugin with Ionic iOS webview... Could the GCDWebServer be removed for iOS to build without issues?
from cordova-plugin-webserver.
@samuelsont No it's not fixed yet.
You could try to build it without the GCDWebserver...
from cordova-plugin-webserver.
I will try that. It should work.
However, I'm kinda lost on some important details. I guess the webserver starts in the same directory as the calling script. Is there a way to specify the www root folder? Also, how do I check and verify the webserver ip and port?
from cordova-plugin-webserver.
The lastest version of cordova-plugin-webserver uses CocoaPods as iOS package manager to pull in GCDWebServer. Can anyone confirm if the latest version resolves this issue?
from cordova-plugin-webserver.
Still lots of ppl using plain Cordova without Ionic (I might mention). ;)
from cordova-plugin-webserver.
looks like this may have been fixed for IOS ionic-team/cordova-plugin-ionic-webview#244
from cordova-plugin-webserver.
Related Issues (20)
- Can't init `webserver` - Can't set a GET path.
- Could not send response to the client HOT 1
- 'GCDWebServer.h' file not found HOT 4
- [bug] Headers are not presented in case of file serving
- Feature request: From base64 to response HOT 5
- Unclear way to set up the java files to use with javascript
- Wait for response to be finished and return possible error
- 1.0.4 does not install properly HOT 1
- 'webserver' is not defined HOT 2
- Point webserver to dataDirectory? HOT 1
- "webserver" or "window.webserver" always undefined...
- Capacitor Support
- Websocket response HOT 2
- Unable to install HOT 1
- Binary Responses
- not working HOT 1
- Can you provide a license file please? HOT 2
- Website accessible from a browser, but not from fetch? HOT 1
- Build fails for ios. GCDWebServer is not configured correctly? HOT 1
- Function documentation in README not correct
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-webserver.