Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

deafult to 127.0.0.1 for host, use 0.0.0.0 for nodejitsu

  • Loading branch information...
commit 51d8e4ff7e9cc7f284864766891e4021e0be8ce0 1 parent 347e6b4
@caolan authored
Showing with 19 additions and 17 deletions.
  1. +19 −17 lib/config.js
View
36 lib/config.js
@@ -19,9 +19,9 @@ exports.getConfig = function (platform, env, project_dir) {
var pkgfile = path.resolve(project_dir, 'package.json');
// default platform-agnostic config
- var config = {
+ var cfg = {
project_dir: project_dir,
- host: '0.0.0.0',
+ host: '127.0.0.1',
@janl
janl added a note

Why? That way the .xip.xio trick stops working

@caolan Owner
caolan added a note

I don't expect development servers to start up publicly available. Anyway, we won't need .xip.io domains with the new /_admin and /_api urls right?

@janl
janl added a note

.xip.io is useful for sharing a dev instance of an app with other machines and mobile device on the local LAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
app: JSON.parse(fs.readFileSync(pkgfile)),
domain: 'dev',
local_tld: false,
@@ -37,33 +37,35 @@ exports.getConfig = function (platform, env, project_dir) {
};
// add CouchDB paths to config
- config = _.extend(config, exports.getCouch(env));
+ cfg = _.extend(cfg, exports.getCouch(env));
// add Hoodie paths to config
- config = _.extend(config, exports.getHoodie(platform));
+ cfg = _.extend(cfg, exports.getHoodie(platform));
// set path to Hoodie app's data directory
- config.hoodie.app_path = path.resolve(
- config.hoodie.apps_path,
- config.app.name
+ cfg.hoodie.app_path = path.resolve(
+ cfg.hoodie.apps_path,
+ cfg.app.name
);
- // start local couch by default
- config.couch.run = true;
- config.couch.port = 6004;
- config.couch.url = 'http://' + config.host + ':' + config.couch.port;
-
// do magic firewall stuff for .dev domains on mac
if (platform === 'darwin') {
- config.local_tld = true;
+ cfg.local_tld = true;
}
- // Nodejitsu config
if (exports.isNodejitsu(env)) {
- config.couch.run = false;
- config.domain = 'jit.su';
+ // Nodejitsu config
+ cfg.host = '0.0.0.0';
+ cfg.domain = 'jit.su';
+ cfg.couch.run = false;
+ }
+ else {
+ // start local couch
+ cfg.couch.run = true;
+ cfg.couch.port = 6004;
+ cfg.couch.url = 'http://' + cfg.host + ':' + cfg.couch.port;
}
- return config;
+ return cfg;
};
/**
Please sign in to comment.
Something went wrong with that request. Please try again.