Skip to content

Commit d3adc99

Browse files
committed
v1.1.0: Do not use babel-node in production. Credit to Alex Driaguine.
1 parent f0ff2d9 commit d3adc99

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import compression from 'compression';
22
import express from 'express';
33
import fs from 'fs';
4+
import path from 'path';
45
import request from 'request';
56

67
const app = express();
78
const port = process.env.PORT || 8080;
89
app.use(compression());
910

1011
let keys;
11-
if (fs.existsSync('./keys.json')) {
12-
keys = require('./keys.json');
12+
if (fs.existsSync(path.join(__dirname, '/keys.json'))) {
13+
keys = require(path.join(__dirname, '/keys.json'));
1314
} else {
1415
keys = JSON.parse(process.env.VCAP_SERVICES)['user-provided'][0].credentials;
1516
}

manifest-staging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ applications:
66
disk_quota: 256MB
77
memory: 128MB
88
services:
9-
- keys
9+
- keys

manifest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ applications:
66
disk_quota: 256MB
77
memory: 128MB
88
services:
9-
- keys
9+
- keys

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
22
"name": "create-react-app-devops",
3-
"version": "0.1.0",
3+
"version": "1.1.0",
44
"private": true,
55
"dependencies": {
6-
"babel-cli": "^6.23.0",
7-
"babel-preset-es2015": "^6.22.0",
8-
"babel-preset-stage-2": "^6.22.0",
96
"compression": "^1.6.2",
107
"express": "^4.15.2",
118
"react": "^15.4.2",
129
"react-dom": "^15.4.2",
1310
"request": "^2.80.0"
1411
},
1512
"devDependencies": {
13+
"babel-cli": "^6.23.0",
14+
"babel-preset-es2015": "^6.22.0",
15+
"babel-preset-stage-2": "^6.22.0",
1616
"babel-watch": "^2.0.6",
1717
"concurrently": "^3.4.0",
1818
"react-scripts": "0.9.4"
1919
},
2020
"proxy": "http://localhost:8081",
2121
"scripts": {
22-
"bluemix": "babel-node index.js",
22+
"bluemix": "node build/index.js",
2323
"start": "concurrently \"PORT=8080 react-scripts start\" \"PORT=8081 babel-watch index.js\"",
24-
"build": "react-scripts build",
24+
"build": "react-scripts build && babel index.js -d build",
2525
"test": "react-scripts test --env=jsdom",
2626
"eject": "react-scripts eject"
2727
},

0 commit comments

Comments
 (0)