Trying to set up a Meteor on an AWS/EBS (Amazon Web Services, Elastic Beanstalk) environment.
A Meteor dev-run can be passed a command line flag: --settings s
Tested another workaround.
after meteor build --directory
edit main.js as following
process.argv.splice(2, 0, 'program.json');
var settingfilename = './settings.json';
if (process.env.METEOR_SETTING_FILE)
settingfilename = process.env.METEOR_SETTING_FILE;
var settings = require(settingfilename);
if (settings) {
try {
process.env.METEOR_SETTINGS = JSON.stringify(settings);
} catch (e) {
console.error(e);
}
}
process.chdir(require('path').join(__dirname, 'programs', 'server'));
require('./programs/server/boot.js');
and copy settings.json into bundle/ and eb init and eb deploy.
you can set the other settings file with adding METEOR_SETTING_FILE at Environment Properties in Configuration tab from EB Console.
editing file is needed after every build.
added the patch file to use in the build script like ed - ../build/bundle/main.js < main.js.patch
main.js.patch
8a
var settingfilename = './settings.json';
if (process.env.METEOR_SETTING_FILE)
settingfilename = process.env.METEOR_SETTING_FILE;
var settings = require(settingfilename);
if (settings) {
try {
process.env.METEOR_SETTINGS = JSON.stringify(settings);
} catch (e) {
console.error(e);
}
}
// console.log (JSON.stringify(process.env));
.
w