Skip to content

Commit f7c0ad8

Browse files
author
Parth Shah
committed
changing env variable
1 parent 1866db1 commit f7c0ad8

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

.ebextensions/01-environment-variables.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ option_settings:
33
option_name: AUTH_DOMAIN
44
value: topcoder-dev.com
55
- namespace: aws:elasticbeanstalk:application:environment
6-
option_name: ENVIRONMENT
6+
option_name: NODE_ENV
77
value: development
88
- namespace: aws:elasticbeanstalk:application:environment
99
option_name: NEW_RELIC_LICENSE_KEY

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Microservice to manage CRUD operations for all things Projects.
1515
~/Projects/tc-projects-service/local
1616
> docker-compose up
1717
```
18-
Copy config/sample.local.js as config/local.js, update the properties and according to your env setup
18+
Copy config/sample.local.js as config/local.js, update the properties and according to your env setup
1919

2020
#### Database
2121
Once you start your PostgreSQL database through docker, it will create a projectsDB.
2222
*To create tables - note this will drop tables if they already exist*
2323
```
24-
npm run -s build
25-
> ENVIRONMENT=development node -e "require('./dist/models').default.sequelize.sync({force: true}).then((res)=> console.log('Success: ', res)).catch((err)=> console.log('Failed: ', err));"
24+
npm run -s build
25+
> NODE_ENV=development node -e "require('./dist/models').default.sequelize.sync({force: true}).then((res)=> console.log('Success: ', res)).catch((err)=> console.log('Failed: ', err));"
2626
```
2727

2828
#### Redis

config/sample.local.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// force using test.json for unit tests
22

33
var config
4-
if (process.env.ENVIRONMENT === 'test') {
4+
if (process.env.NODE_ENV === 'test') {
55
config = require('./test.json')
66
} else {
77
config = {

newrelic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* description of configuration variables and their potential values.
88
*/
99
var appName = "tc-projects-service"
10-
if (process.env.ENVIRONMENT === 'development') {
10+
if (process.env.NODE_ENV === 'development') {
1111
appName += "-dev"
12-
} else if (process.env.ENVIRONMENT === 'qa') {
12+
} else if (process.env.NODE_ENV === 'qa') {
1313
appName += "-qa"
1414
} else {
1515
appName += '-prod'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Projects microservice",
55
"main": "index.js",
66
"scripts": {
7-
"test": "ENVIRONMENT=test ./node_modules/.bin/mocha --compilers js:babel-core/register $(find src -path '*spec.js*')",
7+
"test": "NODE_ENV=test ./node_modules/.bin/mocha --compilers js:babel-core/register $(find src -path '*spec.js*')",
88
"dev": "PORT=8001 nodemon -w src --exec \"babel-node src --presets es2015\" | ./node_modules/.bin/bunyan",
99
"build": "babel src -d dist --presets es2015",
1010
"start": "node dist",

src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ app.use(addRequestId)
3232
// Loger =========
3333
// =======================
3434
let appName = 'tc-projects-service'
35-
switch (process.env.ENVIRONMENT.toLowerCase()) {
35+
switch (process.env.NODE_ENV.toLowerCase()) {
3636
case 'development':
3737
appName += "-dev"
3838
break

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
// include newrelic
4-
if (process.env.ENVIRONMENT !== 'test' && process.env.ENVIRONMENT !== 'local') {
4+
if (process.env.NODE_ENV !== 'test' && process.env.NODE_ENV !== 'local') {
55
require('newrelic')
66
}
77

src/routes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ router.use((err, req, res, next) => { // eslint-disable-line no-unused-vars
7171

7272
// dvalidateelopment error handler
7373
// will print stacktrace
74-
if (_.indexOf(['development', 'test', 'qa'], process.env.ENVIRONMENT) > -1) {
74+
if (_.indexOf(['development', 'test', 'qa'], process.env.NODE_ENV) > -1) {
7575
body.result.debug = err.stack
7676
if (err.details) {
7777
body.result.details = err.details

src/services/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import RabbitMQService from './rabbitmq'
99
*/
1010
module.exports = (app, logger) => {
1111
app.services = app.service || {}
12-
if (process.env.ENVIRONMENT.toLowerCase() === 'test') {
12+
if (process.env.NODE_ENV.toLowerCase() === 'test') {
1313
require('../tests/serviceMocks')(app)
1414
} else {
1515
// RabbitMQ Initialization
@@ -37,7 +37,7 @@ module.exports = (app, logger) => {
3737
// hosts: config.get('esUrl'),
3838
// apiVersion: '1.5'
3939
// }
40-
// if (process.env.ENVIRONMENT.toLowerCase() !== 'local') {
40+
// if (process.env.NODE_ENV.toLowerCase() !== 'local') {
4141
// _.assign(esConfig, {
4242
// connectionClass: require('http-aws-es'),
4343
// amazonES: {

0 commit comments

Comments
 (0)