GithubHelp home page GithubHelp logo

bykof / cordova-plugin-webserver Goto Github PK

View Code? Open in Web Editor NEW
122.0 122.0 51.0 649 KB

A webserver plugin for cordova

License: Other

Java 52.27% Swift 27.60% JavaScript 19.14% Objective-C 0.99%
backend cordova http plugin requests response rest webserver

cordova-plugin-webserver's People

Contributors

boedy avatar bykof avatar dependabot[bot] avatar evildrw avatar fb64 avatar kukukk avatar nadinengland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-webserver's Issues

Serve BIN file on GET request

I'm looking for a way to serve a bin file (with sensitivity for changes) upon GET request, and read the callback once download was complete/successful.
I understand its not possible to serve file for download using this module (no root dir) but perhaps there is a cool way like in your example?

plugin_not_installed on android

I want to use the WebServer in an Ionic4 app on android and IOS, build with angular.

I installed the plugin via
ionic cordova plugin add https://github.com/bykof/cordova-plugin-webserver
npm install --save @ionic-native/web-server

I importet WebService in app.module.ts in providers
import { WebServer } from '@ionic-native/web-server/ngx';

I want to create a service, with the following code:

`constructor(private myServer: WebServer, private networkFinder: NetworkFinderService, private platform: Platform) {

this.IP = networkFinder.clientInformation.IP;
this.platform.ready().then(() => {
  this.myServer.onRequest().subscribe(request => {
    const response = {
      status: 200,
      body: 'Working',
      headers: {
        'Content-Type': 'text/html'
      }
    };
    console.log('Request: ', request);
    this.myServer.sendResponse(request.requestId, response);
  });

  this.myServer.start(PORT)
  .then(() =>  {
    console.log('Start Webserver on ', this.IP, ':', PORT);
  }).catch((error) => {
    console.error(error);
  });
});

}`

But i also tried this in app.component.ts in the constructor.

Then i build the android apk and run on the device via cordova.

Put i alwas get the error: plugin_not_installed.

Does anybody knows the solution?

Thanks for help

Not work with ionic2

When i test with pure cordova it work, but when i test with ionic cordova it not work.
How to fix this?

Service Workers

Have you or anyone used this to hack out service workers in plain Cordova w/o Ionic?

Feature request: From base64 to response

Hello, in my project i have files stored inside an sqlite database. I want that files to be response by local webserver, so with the actual implemention i need to write them on disk to be response later using the "path" property.

For me it would be great it the webserve can decode a base64 string, it is a tricky implementation for android but i have no idea to do it for iOS.

In NanoHTTPDWebserver-->serve i add this condition

**
else if (responseObject.has("base64")){
try {
String base64 = responseObject.getString("base64");
byte[] bytes = Base64.decode(base64, Base64.DEFAULT);
return newFixedLengthResponse(
Response.Status.lookup(responseObject.getInt("status")),
getContentType(responseObject),
new ByteArrayInputStream(bytes), bytes.length);
} catch (JSONException e) {
e.printStackTrace();
}
return response;
}
**

Do you think it has sense to add this feature in your project?

Regards, Enrique

Filesystem?

Hey
Does this allow accessing the filesystem?

If that is the case, there should be a form of authentication. Maybe a key/value token, allowing limited access.
Also an option like accessing types of files, images, mp3s, etc only should be allowed.

不能配置根目录

我们项目需求是在离线情况去访问一个本地的目录的资源,但是现在的插件是不能满足需求的,可以改进一下吗

Partial Content Support (i.e. streaming videos)

Hey @bykof,

First off, superb Cordova plugin. It's been a life saver having GCGWebServer wrapped and packaged up neatly.

I am using the local webserver as a proxy for cdvfile:// urls, which works great but I've come across an issue. In order to get it working I've had to send the Accept-Ranges header when I am serving video files:

// entry is a cordova-plugin-file 
webserver.sendResponse(request.requestId, {
	path: entry.nativeURL.replace('file://', ''),
	headers: {
		'Content-Type': file.type,
		'Accept-Ranges': 'bytes',
		'Access-Control-Allow-Origin': '*',
	},
});

This does indeed trigger the web view to request the content in chunks, however in order to get GCDWebServer to respond with partial content I've had to make changes to Webserver.swift:

-    func fileRequest(path: String) -> GCDWebServerResponse {
+    func fileRequest(request: GCDWebServerRequest, path: String) -> GCDWebServerResponse {
         // Check if file exists, given its path
         if !(FileManager.default.fileExists(atPath: path)) {
             return GCDWebServerResponse(statusCode: 404);
         }
        
+         if (request.hasByteRange()) {
+             return GCDWebServerFileResponse(file: path, byteRange: request.byteRange)!
+         }
+        
         return GCDWebServerFileResponse(file: path)!
     }
         // Check if a file path is provided else use regular data response
         let response = responseDict["path"] != nil
-             ? fileRequest(responseDict["path"] as! String)
+             ? fileRequest(request: request, path: responseDict["path"] as! String)
              : GCDWebServerDataResponse(text: responseDict["body"] as! String)

(I'm not 100% certain on the swift/obj-c inter-op, but I presume it is using this method: https://github.com/swisspol/GCDWebServer/blob/master/GCDWebServer/Responses/GCDWebServerFileResponse.h#L94)

Can you see any issues with doing this? If not, and you think it'd be useful I'll send over a pull request.

Uncaught ReferenceError: webserver is not defined

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");});
});`

Server doesn't run

I install your plugin in my cordova project
I run my application, on an Android 7
Inside my deviceReady, I initiate the onRequest and start the server without error.

webserver.onRequest(this.onRequest.bind(this));
webserver.start();

But I can't access to the server

I try, in chrome on the phone itself : http://127.0.0.1/ and http://localhost/
and I try, from my computer : http://myipaddress/

Not working even after following the documentation

Hi there, @bykof @kukukk
I am trying to use this package to setup a web server in my ionic 3 app, but it is not going right.
I tried many ways to make it work, but still no luck. I am attaching my code which I am using(followed the ionic cordova official docs) and with this code, my app is building properly, but the server doesn't work on requesting it with Postman.
I think the web server isn't initializing on start (in ionViewDidLoad() )


//home.ts
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

import { WebServer } from '@ionic-native/web-server';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})

export class HomePage {

  private port: number;

  constructor(public navCtrl: NavController,
    private webServer: WebServer) {

  }

  ionViewDidLoad() {
    this.port = 1234;
    
    this.webServer.onRequest().subscribe(data => {
      console.log(data);
      const res: any = {
        status: 200,
        body: '',
        headers: {
          'Content-Type': 'text/html'
        }
      };

      this.webServer.sendResponse(data.requestId, res)
        .catch((error: any) => console.error(error));
    });

    this.webServer.start(this.port)
      .catch((error: any) => console.error(error));

    console.log('server started at port : ', this.port);
    
  }

  ionViewWillEnter() {

  }

  ionViewWillUnload() {
    // this.webServer.stop();
  }




}

//package.json
{
  "name": "webServer",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/core": "~4.15.0",
    "@ionic-native/splash-screen": "~4.15.0",
    "@ionic-native/status-bar": "~4.15.0",
    "@ionic-native/web-server": "^4.15.0",
    "@ionic/storage": "2.2.0",
    "cordova-android": "~7.0.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.1.4",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-webserver": "git+https://github.com/bykof/cordova-plugin-webserver.git",
    "cordova-plugin-whitelist": "^1.3.3",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.0",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-webserver": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": [
      "android"
    ]
  }
}

<!-- home.html -->
<ion-header>
  <ion-navbar>
    <ion-title>
      Ionic Web Server
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>
  <p>The app is running on port : {{port}}</p>
  <button (click)="sommething()">
    Click Me
  </button>
  <p id="something"></p>
</ion-content>

And, one more thing, when I run the app in my android device and inspect it with Chrome Dev Tools, I get some warnings in my console saying that, web server plugin is not installed and couldn't find the ionic cordova plugin for web server.
Please refer to this pic:

problem in web server plugin

So, I really don't know what's going on because I really installed everything correctly but still the warnings comes up and the package isn't working.
Please help :)

Not working

I have this JS in the index.html phonegap app. Testing on Android 6

app.initialize();

function onLoad() {
    document.addEventListener("deviceready", onDeviceReady, false);
}

webserver.onRequest(
            function(request) {
                console.log("O MA GAWD! This is the request: ", request);
                document.getElementById("server").innerHTML = "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() {
        alert('Success!');
      },
      function() {
        alert('Error!');
      },
      1337
);

function request(method, url, data, callback) {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState === 4 && this.status === 200) {
      callback(this);
    }
  };
  xhttp.open(method, url, true);
  xhttp.send(data);
}

function sendReq() {
    request('GET', 'localhost:8080', undefined, function (response) {
        document.getElementById("response").innerHTML = JSON.stringify(response);
    });
}
<body  onload="onLoad()">
    <p id="server"></p> <!--- To show server responded -->
    <p><input type="button" value="Send Request" onclick="sendReq()" /></p>
    <p id="response"></p> <!-- To show XHR response -->
</body>

Nothing happens. I can't even know if the server has started. Doing a curl request gives

curl: (7) Failed to connect to 192.168.1.2 port 1337: Connection refused

There should be some way to know that the server has started and get the address printed.
Now is this code okay? Where is it wrong?

Memory usage

Hi!

When I played with the project on iOS I encountered some memory issues. I think it was because in Webserver.swift you never empty the self.responses variable. I used the webserver to forward files having a few MB in size and it caused the high memory usage. Maybe you should do some proper cleanup and after the request is processed remove it from self.responses.

Unable to configure root directory

Our project requirement is to access a local directory resource offline, but the plug-in can't meet the requirement now. Can we improve it?

"webserver" or "window.webserver" always undefined...

Hello
I use cordova (8.1.2) with VueJs, with cordova-plugin-webserver 1.0.3 (1.0.4 does not install)

I already added cordova.js script tag in index.html.

When I call window.webserver or webserver (after deviceready event is fired), the result is always undefined...

I've seen that the problem has arrived to others devs, but any solution on my side..

this.nanoHTTPDWebserver.getHostname() returns NULL

I am able to successfully run on Android.

But I am noticing on the logs:

org.apache.cordova.plugin.Webserver﹕ Server is running on: null:8080

this.nanoHTTPDWebServer.getHostname() always returns null.

Is this a known issue?

I hope to display the ip address of the mobile client for easy reference. Would like to know if there are other ways to get it.

Minimum cordova version

I am seeing in plugin.xml:

<engine name="cordova" version=">=7.0.0" />

whereas in package.json it is

"cordova": "^6.1.1"

Must cordova be greater than 7.0.0 or is it compatible with 6.1.1 as well?

1.0.4 does not install properly

When installing version 1.0.4 most of the files are missing.

on Windows:

mkdir test
cd test
npm init (accepting all defaults)

C:\Users\Papa\test>npm i -s cordova-plugin-webserver

  • [email protected]
    added 1 package and audited 1 package in 0.72s
    found 0 vulnerabilities

cd node_modules\cordova-plugin-webserver

04/26/2020 10:16 AM

.
04/26/2020 10:16 AM ..
04/26/2020 10:16 AM 1,226 package.json
10/26/1985 02:15 AM 328 README.md
2 File(s) 1,554 bytes
2 Dir(s) 60,815,167,488 bytes free

NOTE: installing 1.0.3 does get all of the files.

Thank you :)

'GCDWebServer.h' file not found

#46 caused the following error with ionic environment.

platforms/ios/MyApp/Bridging-Header.h:29:
#import "./Plugins/cordova-plugin-webserver/GCDWebServer-Bridging-Header.h"
        ^
.../platforms/ios/MyApp/./Plugins/cordova-plugin-webserver/GCDWebServer-Bridging-Header.h:1:9: error: '<GCDWebServer/GCDWebServer.h>' file not found
#import <GCDWebServer/GCDWebServer.h>
        ^
1 error generated.
<unknown>:0: error: failed to emit precompiled header '...platforms/ios/build/sharedpch/Bridging-Header-swift_1UWTFZ0A2P88V-clang_1UVAGXMHPL745.pch' for bridging header '../platforms/ios/MyApp/Bridging-Header.h'

<unknown>:0: error: generate-pch command failed with exit code 1 (use -v to see invocation)
** ARCHIVE FAILED **

I used previous version to void this problem:

ionic cordova plugin add https://github.com/bykof/cordova-plugin-webserver.git#c509f3d87260ae4a91cd1810b7be33442decdc45

Please check if this is a bug or how to fix it.

I would suggest requesting the ownership of cordova-plugin-webserver npm to be official so that users don't have to install it by typing the GitHub address. You can find more help here: https://docs.npmjs.com/transferring-a-package-from-a-user-account-to-another-user-account.

'webserver' is not defined

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?

[bug] Headers are not presented in case of file serving

If we are trying to server file, headers are not presented in response. Basic code to reproduce is:

window.webserver.sendResponse(
  request.requestId,
  {
    status: 200,
    path: <some_path>,
    headers: {
      '<some_header>': '<some_value>'
    }
  }
)

On client side we will receive file with length and correct type header (doubled sometime, but correct after all), but no <some_header> at all.

Android is confirmed at the moment. Will dig in iOS soon.

Header response with 2 "Content-Type"

When the browser receive my response the header content 2 "Content-Type"
The following code is what I send.

webserver.sendResponse(request.requestId, {
          status: status,
          body: body,
          headers: {'Content-Type': 'text/css'}
        });

And I receive

Connection:keep-alive
Content-Encoding:gzip
Content-Type:text/plain
Content-Type:text/css
Date:Thu, 28 Sep 2017 22:45:10 GMT
Transfer-Encoding:chunked

If my "Content-Type" are "text/html; charset=UTF-8" or "application/javascript; charset=UTF-8"
This doesn't not really matter, but when I send "text/css", the browser don't use the body as a stylesheet.

Could not send response to the client

Hi, thank you for your amazing work !

Sometime, webserver stop working, this is the logcat :

[ 09-13 16:35:49.614 19835:25848 E/fi.iki.elonen.NanoHTTPD ]
Could not send response to the client
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at fi.iki.elonen.NanoHTTPD$Response$ChunkedOutputStream.write(NanoHTTPD.java:1443)
at fi.iki.elonen.NanoHTTPD$Response$ChunkedOutputStream.write(NanoHTTPD.java:1435)
at java.util.zip.GZIPOutputStream.writeHeader(GZIPOutputStream.java:182)
at java.util.zip.GZIPOutputStream.(GZIPOutputStream.java:94)
at java.util.zip.GZIPOutputStream.(GZIPOutputStream.java:109)
at fi.iki.elonen.NanoHTTPD$Response.sendBodyWithCorrectEncoding(NanoHTTPD.java:1663)
at fi.iki.elonen.NanoHTTPD$Response.sendBodyWithCorrectTransferAndEncoding(NanoHTTPD.java:1654)
at fi.iki.elonen.NanoHTTPD$Response.send(NanoHTTPD.java:1624)
at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:957)
at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
at java.lang.Thread.run(Thread.java:764)

Have you got an idea ?

port issue

how do i make sure the port is not used by any other instance if i choose port by myself there is some % chance that that port might be in use ..is there way to programatically access the free port given by the system

CORS Options

Hello,

I need to pass CORS headers into the OPTIONS request. Chrome block the request before it can get into the plugin:

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

                    (<any>window).webserver.sendResponse(
                        request.requestId,
                        {
                            status: 200,
                            body: '<html>Hello World</html>',
                            headers: {
                                'content-type': 'text/html',
                                "Access-Control-Allow-Origin": "*",
                                "Access-Control-Allow-Headers" : "content-type,transaction",
                                "Access-Control-Allow-Methods" : "GET,HEAD,PUT,PATCH,POST,DELETE"
                            }
                        }
                    );
                }
            );`

Is there any way to implement it?

not able to run on IOS

I add plugin, added platform, and when I try to run I see the below error messages.

$ cordova run ios
Script file does't exist and will be skipped: /Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/plugins/cordova-plugin-add-swift-support/add-swift-support.js
Building project: /Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/platforms/ios/HelloCordova.xcworkspace
Configuration: Debug
Platform: device
User defaults from command line:
IDEArchivePathOverride = /Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/platforms/ios/HelloCordova.xcarchive

Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/platforms/ios/build/sharedpch

Build settings from configuration file '/Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h

error: archive not found at path '/Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/platforms/ios/HelloCordova.xcarchive'
** EXPORT FAILED **

CordovaError: Promise rejected with non-error: 'Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,HelloCordova.xcarchive,-exportOptionsPlist /Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/platforms/ios/exportOptions.plist,-exportPath,/Users/xxxx/project/bykof/cordova-plugin-webserver/WISPr/platforms/ios/build/device'
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at process._tickCallback (internal/process/next_tick.js:68:7)

Conflicting with cordova-plugin-ionic-webview

Hi,

I wanted to try your plugin on iOS. A created a fresh new Ionic project and added your plugin. But when I try to build it I get an error. I tried from command line with "ionic cordova build ios" and also from Xcode but I got the following error: "197 duplicate symbols for architecture arm64".

After some more digging I found out that when I add the ios platform to ionic it automatically includes the cordova-plugin-ionic-webview plugin which also contains GCDWebServer. This is where the duplicate symbol error comes from.

Do you have an idea how to workaround this problem?

I'm using:

Update:
If I remove cordova-plugin-ionic-webview it works. But, since it is include in Ionic by default, I'm not sure whether it is a good solution or not...

Wait for response to be finished and return possible error

Currently once the response is send we do not know when it is finished.

Wouldnt it be possible to pass the callback into the responses array and then call the success callback once it is finished?

Just pass callback here:

https://github.com/bykof/cordova-plugin-webserver/blob/master/src/android/Webserver.java#L105

and call here:

https://github.com/bykof/cordova-plugin-webserver/blob/master/src/android/NanoHTTPDWebserver.java#L250
https://github.com/bykof/cordova-plugin-webserver/blob/master/src/android/NanoHTTPDWebserver.java#L271

Point webserver to dataDirectory?

Dear @bykof , you have a great solution, I was able to integrate it into my app, but the only very valuable thing I can't handle is:
I need to point webserver to device dataDirectory (e.g. cordova.file.dataDirectory), to be able put there several files (e.g. http://localhost:8084/myimage.png etc) and after call them within the app.

My I ask you a favor to implement this feature?
Can I collaborate/donate your project in any way?

I saw that GCDWebServer has a method addGETHandlerForBasePath to do it
https://stackoverflow.com/questions/30984084/gcdwebserver-static-files-from-documents
Unfortunately I don't have enough skills to modify your plugin ((

Start versioning plugin and Publish to NPM

We should start versioning this plugin and publishing it NPM to prevent breaking app integrations in the future. Currently there is another plugin with the same name which is occupying the cordova-plugin-webserver namespace. I've reached out to the maintainers to see if its possible to merge the two projects.

If there is no response we should consider publishing it under a different alias. cordova-plugin-http-server perhaps?

Failed to generate IOS build on phonegap

Error - Plugin error (you probably need to remove plugin files from your app): //github.com/bykof/cordova-plugin-webserver --nohooks=.": Fetching plugin "https://github.com/bykof/cordova-plugin-webserver" via git clone Using shallow clone Repository "https://github.com/bykof/cordova-plugin-webserver" checked out to git ref "master" at "64f3e3a". Installing "cordova-plugin-webserver" at "1.1.0" for ios Fetching plugin "[email protected]" via npm Installing "cordova-plugin-add-swift-support" at "2.0.2" for ios Failed to install 'cordova-plugin-webserver': Error: pod: Command failed with exit code 1 at ChildProcess.whenDone (/private/tmp/gimlet/3428228/project/cordova/node_modules/cordova-common/src/superspawn.js:169:23) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Socket.stream.socket.on (internal/child_process.js:381:11) at Socket.emit (events.js:182:13) at Pipe._handle.close (net.js:611:12)

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.