This repository was archived by the owner on Jul 9, 2019. It is now read-only.
File tree 4 files changed +18
-14
lines changed
4 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 1
1
FROM ubuntu
2
2
3
3
4
- # ENV WEB_API_URL https://enigmatic-meadow-89512.herokuapp.com
4
+ EXPOSE 1883
5
+ EXPOSE 8883
6
+ EXPOSE 80
7
+ EXPOSE 443
8
+ EXPOSE 3002
9
+
5
10
RUN apt-get update
6
11
RUN apt-get install -y curl
7
12
Original file line number Diff line number Diff line change
1
+ var log = require ( "./logger" ) ;
2
+
1
3
// TODO: Clean up ENV management into something less crappy.
2
4
// or use a 3rd party node ENV manager module.
5
+ var DEFAULT_URL = "http://localhost:3000" ;
3
6
4
7
var webAppUrl ;
5
- var log = require ( "./logger" ) ;
6
-
7
8
if ( process . env . WEB_API_URL ) {
8
- webAppUrl = process . env . WEB_API_URL ;
9
+ webAppUrl = process . env . WEB_API_URL ;
9
10
} else {
10
- missing ( "WEB_API_URL" ) ;
11
+ webAppUrl = DEFAULT_URL ;
12
+ log ( "You did not set WEB_API_URL. Defaulting to " + DEFAULT_URL ) ;
11
13
}
12
14
13
15
module . exports = {
14
- webAppUrl : webAppUrl ,
15
- httpPort : 3002 ,
16
- mqttPort : 1883
17
- }
18
-
19
- function missing ( varName ) {
20
- log ( "You did not set the `" + varName + "` ENV var." ) ;
16
+ webAppUrl : webAppUrl ,
17
+ httpPort : 3002 ,
18
+ mqttPort : 1883
21
19
}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ var input = {
11
11
static : "./public"
12
12
}
13
13
} ;
14
+
14
15
maybeEnableSSL ( input )
15
16
var server = new Server ( input ) ;
16
17
Original file line number Diff line number Diff line change 5
5
"main" : " app/index.js" ,
6
6
"scripts" : {
7
7
"start" : " node app/index.js" ,
8
- "test" : " WEB_API_URL=http://localhost:3000 node_modules/.bin/istanbul cover node_modules/.bin/jasmine" ,
8
+ "test" : " node_modules/.bin/istanbul cover node_modules/.bin/jasmine" ,
9
9
"dev" : " WEB_API_URL=http://localhost:3000 node app/index.js"
10
10
},
11
11
"repository" : {
28
28
"istanbul" : " ^0.4.4" ,
29
29
"jasmine" : " ^2.4.1"
30
30
}
31
- }
31
+ }
You can’t perform that action at this time.
0 commit comments