Skip to content

Commit

Permalink
v1.1.0: Do not use babel-node in production. Credit to Alex Driaguine.
Browse files Browse the repository at this point in the history
  • Loading branch information
seejamescode committed Mar 20, 2017
1 parent f0ff2d9 commit d3adc99
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import compression from 'compression';
import express from 'express';
import fs from 'fs';
import path from 'path';
import request from 'request';

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

let keys;
if (fs.existsSync('./keys.json')) {
keys = require('./keys.json');
if (fs.existsSync(path.join(__dirname, '/keys.json'))) {
keys = require(path.join(__dirname, '/keys.json'));
} else {
keys = JSON.parse(process.env.VCAP_SERVICES)['user-provided'][0].credentials;
}
Expand Down
2 changes: 1 addition & 1 deletion manifest-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ applications:
disk_quota: 256MB
memory: 128MB
services:
- keys
- keys
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ applications:
disk_quota: 256MB
memory: 128MB
services:
- keys
- keys
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"name": "create-react-app-devops",
"version": "0.1.0",
"version": "1.1.0",
"private": true,
"dependencies": {
"babel-cli": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-stage-2": "^6.22.0",
"compression": "^1.6.2",
"express": "^4.15.2",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"request": "^2.80.0"
},
"devDependencies": {
"babel-cli": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-stage-2": "^6.22.0",
"babel-watch": "^2.0.6",
"concurrently": "^3.4.0",
"react-scripts": "0.9.4"
},
"proxy": "http://localhost:8081",
"scripts": {
"bluemix": "babel-node index.js",
"bluemix": "node build/index.js",
"start": "concurrently \"PORT=8080 react-scripts start\" \"PORT=8081 babel-watch index.js\"",
"build": "react-scripts build",
"build": "react-scripts build && babel index.js -d build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
Expand Down

0 comments on commit d3adc99

Please sign in to comment.