Code Monkey home page Code Monkey logo

Comments (10)

kukukk avatar kukukk commented on September 16, 2024 1

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.

bykof avatar bykof commented on September 16, 2024

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.

waidp521 avatar waidp521 commented on September 16, 2024

@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.

kukukk avatar kukukk commented on September 16, 2024

@waidp521: Since you are able to build your project you have a different problem.

from cordova-plugin-webserver.

samuelsont avatar samuelsont commented on September 16, 2024

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.

bykof avatar bykof commented on September 16, 2024

@samuelsont No it's not fixed yet.
You could try to build it without the GCDWebserver...

from cordova-plugin-webserver.

samuelsont avatar samuelsont commented on September 16, 2024

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.

boedy avatar boedy commented on September 16, 2024

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.

Mapiac avatar Mapiac commented on September 16, 2024

Still lots of ppl using plain Cordova without Ionic (I might mention). ;)

from cordova-plugin-webserver.

caramorsimon avatar caramorsimon commented on September 16, 2024

looks like this may have been fixed for IOS ionic-team/cordova-plugin-ionic-webview#244

from cordova-plugin-webserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.