File tree 4 files changed +11
-10
lines changed
4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
import compression from 'compression' ;
2
2
import express from 'express' ;
3
3
import fs from 'fs' ;
4
+ import path from 'path' ;
4
5
import request from 'request' ;
5
6
6
7
const app = express ( ) ;
7
8
const port = process . env . PORT || 8080 ;
8
9
app . use ( compression ( ) ) ;
9
10
10
11
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') ) ;
13
14
} else {
14
15
keys = JSON . parse ( process . env . VCAP_SERVICES ) [ 'user-provided' ] [ 0 ] . credentials ;
15
16
}
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ applications:
6
6
disk_quota : 256MB
7
7
memory : 128MB
8
8
services :
9
- - keys
9
+ - keys
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ applications:
6
6
disk_quota : 256MB
7
7
memory : 128MB
8
8
services :
9
- - keys
9
+ - keys
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " create-react-app-devops" ,
3
- "version" : " 0 .1.0" ,
3
+ "version" : " 1 .1.0" ,
4
4
"private" : true ,
5
5
"dependencies" : {
6
- "babel-cli" : " ^6.23.0" ,
7
- "babel-preset-es2015" : " ^6.22.0" ,
8
- "babel-preset-stage-2" : " ^6.22.0" ,
9
6
"compression" : " ^1.6.2" ,
10
7
"express" : " ^4.15.2" ,
11
8
"react" : " ^15.4.2" ,
12
9
"react-dom" : " ^15.4.2" ,
13
10
"request" : " ^2.80.0"
14
11
},
15
12
"devDependencies" : {
13
+ "babel-cli" : " ^6.23.0" ,
14
+ "babel-preset-es2015" : " ^6.22.0" ,
15
+ "babel-preset-stage-2" : " ^6.22.0" ,
16
16
"babel-watch" : " ^2.0.6" ,
17
17
"concurrently" : " ^3.4.0" ,
18
18
"react-scripts" : " 0.9.4"
19
19
},
20
20
"proxy" : " http://localhost:8081" ,
21
21
"scripts" : {
22
- "bluemix" : " babel- node index.js" ,
22
+ "bluemix" : " node build/ index.js" ,
23
23
"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 " ,
25
25
"test" : " react-scripts test --env=jsdom" ,
26
26
"eject" : " react-scripts eject"
27
27
},
You can’t perform that action at this time.
0 commit comments