File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " jsonwebtoken.github.io" ,
3
+ "scripts" : {
4
+ },
5
+ "env" : {
6
+ "NODE_ENV" : {
7
+ "required" : true
8
+ }
9
+ },
10
+ "addons" : [
11
+ " ssl"
12
+ ],
13
+ "buildpacks" : [
14
+ {
15
+ "url" : " heroku/nodejs"
16
+ }
17
+ ]
18
+ }
Original file line number Diff line number Diff line change 3
3
"version" : " 0.0.1" ,
4
4
"dependencies" : {
5
5
"bower" : " ^1.4.1" ,
6
+ "express" : " ^4.13.4" ,
7
+ "express-sslify" : " ^1.0.1" ,
6
8
"grunt" : " ^0.4.5" ,
7
9
"marked" : " ^0.3.5" ,
8
10
"serve" : " *"
25
27
},
26
28
"scripts" : {
27
29
"test" : " grunt test --verbose" ,
28
- "start" : " serve -D --compress --port ${PORT:-3000} . " ,
30
+ "start" : " node server.js " ,
29
31
"watch" : " grunt" ,
30
32
"postinstall" : " bower install"
31
33
}
Original file line number Diff line number Diff line change
1
+ var express = require ( 'express' ) ;
2
+ var http = require ( 'http' ) ;
3
+ var enforce = require ( 'express-sslify' ) ;
4
+
5
+ var app = express ( ) ;
6
+
7
+ // use HTTPS(true) in case you are behind a load balancer (e.g. Heroku)
8
+ if ( process . env . NODE_ENV === 'production' ) {
9
+ console . log ( 'redirecting to ssl' ) ;
10
+ app . use ( enforce . HTTPS ( { trustProtoHeader : true } ) )
11
+ }
12
+
13
+ app . use ( '/' , express . static ( __dirname ) ) ;
14
+
15
+ http . createServer ( app ) . listen ( process . env . PORT || 3000 , function ( ) {
16
+ console . log ( 'started' ) ;
17
+ } ) ;
You can’t perform that action at this time.
0 commit comments