Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Commit f31cc8a

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/server-side/ServerManager.js
2 parents a6e5d66 + 1164d9b commit f31cc8a

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `hapi-react-hot-loader`
1+
# `hapi-react-hot-loader-example`
22
Example application demonstrating react-hot-loader-3 with webpack-2, react and friends, and hapi.
33

44
## get started

Diff for: src/server-side/ServerManager.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as hapi from 'hapi';
1+
import * as Hapi from 'hapi';
22

33
const PORT = process.env.PORT || 3000;
44
const HOST = process.env.HOST || 'localhost';
@@ -8,7 +8,7 @@ class ServerManager {
88

99
static log = () => console.log(`\n\nServer running in ${NODE_ENV} mode at: http://${HOST}:${PORT}\n`);
1010

11-
_server = new hapi.Server({ debug: { request: ['error'] } });
11+
_server = new Hapi.Server({debug: {request: ['error']}});
1212

1313
isProduction = (NODE_ENV === 'production');
1414

Diff for: src/services/ServerService.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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;

0 commit comments

Comments
 (0)