commit | db5625bfe8e7abfa8606e53166df951a5cd78345 | [log] [tgz] |
---|---|---|
author | Tim Barham <tim.barham@microsoft.com> | Fri Oct 16 19:17:03 2015 -0700 |
committer | Tim Barham <tim.barham@microsoft.com> | Wed Oct 21 08:08:09 2015 -0700 |
tree | 7f2a852f522057dff938bfa854593ab50d7e55e9 | |
parent | 1f3daf5409d3be69ef5e3e57d7117b5bb2de8035 [diff] |
On Windows, verify browsers installed before launching. Do this to avoid dialog that pops up if browser is not installed.
This module can be used to serve up a Cordova application in the browser. It has no command-line, but rather is intended to be called using the following API:
var serve = require('cordova-serve'); serve.launchServer(opts); serve.servePlatform(platform, opts); serve.launchBrowser(ops);
launchServer(opts);
Launches a server with the specified options. Parameters:
servePlatform(platform, opts);
Launches a server that serves up any Cordova platform (e.g. browser
, android
etc) from the current project. Parameters:
servePlatform()
, the root
value should be a Cordova project‘s root folder, or any folder within it - servePlatform()
will replace it with the platform’s www_dir
folder. If this value is not specified, the cwd will be used.launchBrowser(opts);
Launches a browser window pointing to the specified URL. The single parameter is an options object that supports the following values (both optional):
chrome
, chromium
, firefox
, ie
, opera
, safari
. If no browser is specified,The opts object passed to launchServer()
and servePlatform()
supports the following values (all optional):
ExpressJS
router. If provided, this will be attached before default static handling.true
, turns off all log output.true
, cordova-serve won't output Static file server running on...
message.EventEmitter
to use for logging. If provided, logging will be output using events.emit('log', msg)
. If not provided, console.log()
will be used. Note that nothing will be output in either case if noLogOutput
is true
.