Skip to content

Commit

Permalink
fix(proxy): use path as startPath if given as proxy option
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Feb 3, 2015
1 parent 1a54312 commit f4ac4c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/public/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ module.exports = function (browserSync, name, pjson) {

var config = merge(args.config)
.withMutations(function (item) {

if (!item.get("server") && !item.get("proxy")) {
item.set("open", false);
}

item.set("version", pjson.version);

if (item.get("files") === false) {
item.set("files", Immutable.List([]));
}

// Promote any url paths given to proxy to
// startPath option
if (item.get("proxy")) {
var path = item.getIn(["proxy", "path"]);
if (path !== "/") {
item.set("startPath", path);
}
}
});

return browserSync.init(config, args.cb);
Expand Down
1 change: 0 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,5 @@ module.exports.portscanner = portScanner;
module.exports.UAParser = UAParser;
module.exports.connect = require("connect");
module.exports.devIp = devIp;
module.exports.open = open;
module.exports.serveStatic = require("serve-static");
module.exports.easyExtender = require("easy-extender");

0 comments on commit f4ac4c5

Please sign in to comment.