Skip to content

Commit

Permalink
[#184] - adding in devmode endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
timkim committed Jan 10, 2017
1 parent 92118c1 commit 2813ebe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/middleware.js
Expand Up @@ -7,6 +7,7 @@ var autoreload = require('./middleware/autoreload'),
connect = require('connect'),
cordova = require('./middleware/cordova/cordova'),
cordova_plugins = require('./middleware/cordova/cordova_plugins'),
devmode = require('./middleware/devmode'),
events = require('events'),
fs = require('fs'),
inject = require('./middleware/inject'),
Expand Down Expand Up @@ -84,6 +85,9 @@ module.exports = function(options) {
// register requires session support
app.use(connect.session({ secret: 'phonegap' }));

// allow client to register devmode plugin is in use and get appID
app.use(devmode(options));

// watch file system for changes and notify client
app.use(autoreload(options));

Expand Down
12 changes: 11 additions & 1 deletion lib/util/injector-transform.js
Expand Up @@ -20,7 +20,17 @@ var fs = require('fs'),

module.exports = function(options) {
options.isBrowser = false;
var injectScript = scripts.getScripts(options);
options.isDevmode = options.isDevmode || false;

var injectScript;

// make sure to only inject scripts for older versions of the PhoneGap Developer App
// ie: before devmode plugin
if(!options.isDevmode) {
injectScript = scripts.getScripts(options);
} else {
injectScript = '';
}

function InjectHTML(options) {
if (!(this instanceof InjectHTML)) {
Expand Down

0 comments on commit 2813ebe

Please sign in to comment.