This repository was archived by the owner on Dec 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1
- # ` hapi-react-hot-loader `
1
+ # ` hapi-react-hot-loader-example `
2
2
Example application demonstrating react-hot-loader-3 with webpack-2, react and friends, and hapi.
3
3
4
4
## get started
Original file line number Diff line number Diff line change 1
- import * as hapi from 'hapi' ;
1
+ import * as Hapi from 'hapi' ;
2
2
3
3
const PORT = process . env . PORT || 3000 ;
4
4
const HOST = process . env . HOST || 'localhost' ;
@@ -8,7 +8,7 @@ class ServerManager {
8
8
9
9
static log = ( ) => console . log ( `\n\nServer running in ${ NODE_ENV } mode at: http://${ HOST } :${ PORT } \n` ) ;
10
10
11
- _server = new hapi . Server ( { debug : { request : [ 'error' ] } } ) ;
11
+ _server = new Hapi . Server ( { debug : { request : [ 'error' ] } } ) ;
12
12
13
13
isProduction = ( NODE_ENV === 'production' ) ;
14
14
Original file line number Diff line number Diff line change
1
+ class ServerService {
2
+
3
+ static createLocationObject ( request ) {
4
+ const protocal = request . headers [ 'x-forwarded-proto' ] || request . connection . info . protocol ;
5
+
6
+ return {
7
+ ...request . url ,
8
+ host : request . info . host ,
9
+ hostname : request . info . host . split ( ':' ) [ 0 ] ,
10
+ href : `${ protocal } ://${ request . info . host } ${ request . url . path } ` ,
11
+ origin : `${ protocal } ://${ request . info . host } ` ,
12
+ pathname : request . url . path . split ( '?' ) [ 0 ] ,
13
+ protocal : `${ protocal } :` ,
14
+ } ;
15
+ }
16
+
17
+ }
18
+
19
+ export default ServerService ;
You can’t perform that action at this time.
0 commit comments