GitHub user TimBarham opened a pull request: https://github.com/apache/cordova-lib/pull/314
Refactor cordova-serve to use Express. This simplifies a lot of code, but more importantly provides a more standardized and modular way to customize the server (via Express middleware). This is a breaking change (so next release should be bumped to `0.2.0`). #### API Changes: * Now call module as a constructor that returns a `cordova-serve` instance. This allows creation of multiple servers listening to different ports. * `launchBrowser()` is a static method of `cordova-serve` * `servePlatform()` and `launchServer()` are instance methods. * `sendStream()` method removed (not needed - just use `send` module). * `opts` parameter loses the following properties: `urlPathHandler`, `streamHandler` and `serverExtender`. These can all be done in other ways (primarily by attaching Express middleware to the `app` property exposed on the `cordova-serve` instance). * `opts` parameter gains the following properties: `router` (an optional Express router that will be attached to server) and `events` (an optional `EventEmitter` which will be used for logging - via `events.emit('log', msg)` - if provided). You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-lib cordova-serve-express Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/314.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #314 ---- commit f140e85f2b68d62f14485b0c1c35afc888e1f05e Author: Tim Barham <tim.bar...@microsoft.com> Date: 2015-10-03T23:34:36Z Refactor cordova-serve to use Express. This simplifies a lot of code, and also provides a more standardized and modular way to customize the server (via Express middleware). Also changes cordova-serve to support multiple instances (i.e. multiple servers). Note that this is a breaking change, so for next release we will need to update the version to 0.2.0 (and I have updates to cordova-browser and cordova-lib ('cordova serve' command) ready to go to make use of this change. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org