mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
read ROOT_URL from environment in commands.js, not runner.js
This commit is contained in:
@@ -155,6 +155,7 @@ main.registerCommand({
|
||||
buildOptions: {
|
||||
minify: options.minify
|
||||
},
|
||||
rootUrl: process.env.ROOT_URL,
|
||||
mongoUrl: process.env.MONGO_URL,
|
||||
oplogUrl: process.env.MONGO_OPLOG_URL,
|
||||
once: options.once
|
||||
@@ -981,6 +982,7 @@ main.registerCommand({
|
||||
settingsFile: options.settings,
|
||||
banner: "Tests",
|
||||
buildOptions: buildOptions,
|
||||
rootUrl: process.env.ROOT_URL,
|
||||
mongoUrl: process.env.MONGO_URL,
|
||||
oplogUrl: process.env.MONGO_OPLOG_URL,
|
||||
once: options.once
|
||||
|
||||
@@ -292,17 +292,6 @@ _.extend(MongoRunner.prototype, {
|
||||
//
|
||||
// If the server fails to start for the first time (after a few
|
||||
// restarts), we'll print a message and give up, returning false.
|
||||
//
|
||||
// XXX XXX this is a change in behavior -- before, whenever mongo
|
||||
// crashed we would restart the app. now they are independent. will
|
||||
// apps tolerate that, or will they die immediately on startup if
|
||||
// they can't make an initial database connection? we should look
|
||||
// into that ... but really, if you think about it, that's not the
|
||||
// right way for apps to behave in a HA environment, because there
|
||||
// is always a race where they fail to start (I suppose you could
|
||||
// take the position that they should be restarted if they fail,
|
||||
// after a short time delay.. but still, that approach will tend to
|
||||
// amplify failures)
|
||||
start: function () {
|
||||
var self = this;
|
||||
|
||||
|
||||
@@ -19,13 +19,15 @@ var Updater = require('./updater.js').Updater;
|
||||
// - add warnings to buildmessage, per slava
|
||||
// - make files.getSettings return errors instead of throwing (or eliminate)
|
||||
// - mv main.js to meteor.js
|
||||
// - search for XXX here and there
|
||||
// - deal with XXX's in updater about it needing to go though runlog since
|
||||
// no more stdout redirection
|
||||
// - kill process.exit everywhere
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// options: port, buildOptions, settingsFile, banner, program,
|
||||
// onRunEnd, onFailure, watchForChanges, noListenBanner, disableOplog,
|
||||
// rawLogs, appDirForVersionCheck
|
||||
// onRunEnd, onFailure, watchForChanges, noListenBanner, rootUrl,
|
||||
// mongoUrl, oplogUrl, disableOplog, rawLogs, appDirForVersionCheck
|
||||
var Runner = function (appDir, options) {
|
||||
var self = this;
|
||||
self.appDir = appDir;
|
||||
@@ -37,11 +39,6 @@ var Runner = function (appDir, options) {
|
||||
self.appPort = self.listenPort + 1;
|
||||
self.mongoPort = self.listenPort + 2;
|
||||
|
||||
// XXX XXX have this be passed in, not slurped from the environment
|
||||
self.rootUrl =
|
||||
var rootUrl = process.env.ROOT_URL ||
|
||||
('http://localhost:' + self.listenPort + '/');
|
||||
|
||||
self.banner = options.banner || files.prettyPath(self.appDir);
|
||||
|
||||
self.runLog = new RunLog({
|
||||
@@ -81,7 +78,7 @@ var Runner = function (appDir, options) {
|
||||
mongoUrl: mongoUrl,
|
||||
oplogUrl: oplogUrl,
|
||||
buildOptions: options.buildOptions,
|
||||
rootUrl: self.rootUrl,
|
||||
rootUrl: options.rootUrl || ('http://localhost:' + self.listenPort + '/'),
|
||||
settingsFile: options.settingsFile,
|
||||
program: options.program,
|
||||
proxy: self.proxy,
|
||||
@@ -148,6 +145,8 @@ _.extend(Runner.prototype, function () {
|
||||
// - banner: replace the application path that is normally printed on
|
||||
// startup with an arbitrary string (eg, 'Tests')
|
||||
// - rawLogs: don't colorize/beautify log messages that are printed
|
||||
// - rootUrl: tell the app that traffic at this URL will be routed to
|
||||
// it at '/' (used by the app to construct absolute URLs)
|
||||
// - disableOplog: don't use oplog tailing
|
||||
// - mongoUrl: don't start a mongo process; instead use the mongo at
|
||||
// this mongo URL
|
||||
|
||||
Reference in New Issue
Block a user