Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
feat(): change http-server to use request hostname instead of the con…
Browse files Browse the repository at this point in the history
…figured hostname.
  • Loading branch information
jthoms1 committed Mar 14, 2017
1 parent 3001190 commit 8e1e81a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/dev-server/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function serveIndex(req: express.Request, res: express.Response) {
const indexFileName = path.join(config.wwwDir, process.env[Constants.ENV_VAR_HTML_TO_SERVE]);
fs.readFile(indexFileName, (err, indexHtml) => {
if (config.useLiveReload) {
indexHtml = injectLiveReloadScript(indexHtml, config.host, config.liveReloadPort);
indexHtml = injectLiveReloadScript(indexHtml, req.hostname, config.liveReloadPort);
}

indexHtml = injectNotificationScript(config.rootDir, indexHtml, config.notifyOnConsoleLog, config.notificationPort);
Expand Down
3 changes: 0 additions & 3 deletions src/dev-server/live-reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ export function injectLiveReloadScript(content: any, host: string, port: Number)
}

function getLiveReloadScript(host: string, port: Number) {
if (host === '0.0.0.0') {
host = 'localhost';
}
var src = `//${host}:${port}/livereload.js?snipver=1`;
return ` <!-- Ionic Dev Server: Injected LiveReload Script -->\n <script src="${src}" async="" defer=""></script>`;
}

0 comments on commit 8e1e81a

Please sign in to comment.