diff --git a/src/dev-server/http-server.ts b/src/dev-server/http-server.ts index ff7c560a..e841c721 100644 --- a/src/dev-server/http-server.ts +++ b/src/dev-server/http-server.ts @@ -4,7 +4,7 @@ import { injectLiveReloadScript } from './live-reload'; import * as express from 'express'; import * as fs from 'fs'; import * as url from 'url'; -import { ServeConfig, LOGGER_DIR } from './serve-config'; +import { ServeConfig, LOGGER_DIR, IONIC_LAB_URL } from './serve-config'; import { Logger } from '../logger/logger'; import * as proxyMiddleware from 'proxy-middleware'; import { injectDiagnosticsHtml } from '../logger/logger-diagnostics'; @@ -25,6 +25,8 @@ export function createHttpServer(config: ServeConfig): express.Application { app.get('/', serveIndex); app.use('/', express.static(config.wwwDir)); app.use(`/${LOGGER_DIR}`, express.static(path.join(__dirname, '..', '..', 'bin'), { maxAge: 31536000 })); + app.get(IONIC_LAB_URL, (req, res) => + res.sendfile('ionic-lab.html', {root: path.join(__dirname, '..', '..', 'bin')})); app.get('/cordova.js', serveCordovaJS); if (config.useProxy) { diff --git a/src/dev-server/serve-config.ts b/src/dev-server/serve-config.ts index 6e07569a..2ccfb9b6 100644 --- a/src/dev-server/serve-config.ts +++ b/src/dev-server/serve-config.ts @@ -15,4 +15,4 @@ export interface ServeConfig { useProxy: boolean; } export const LOGGER_DIR = '__ion-dev-server'; -export const IONIC_LAB_URL = `/${LOGGER_DIR}/ionic-lab.html`; +export const IONIC_LAB_URL = '/ionic-lab';