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

Commit c319404

Browse files
committed
feat(serve): add '/ionic-lab' as an alias for the lab html file path.
1 parent 4d6bbd5 commit c319404

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/dev-server/http-server.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { injectLiveReloadScript } from './live-reload';
44
import * as express from 'express';
55
import * as fs from 'fs';
66
import * as url from 'url';
7-
import { ServeConfig, LOGGER_DIR } from './serve-config';
7+
import { ServeConfig, LOGGER_DIR, IONIC_LAB_URL } from './serve-config';
88
import { Logger } from '../logger/logger';
99
import * as proxyMiddleware from 'proxy-middleware';
1010
import { injectDiagnosticsHtml } from '../logger/logger-diagnostics';
@@ -25,6 +25,8 @@ export function createHttpServer(config: ServeConfig): express.Application {
2525
app.get('/', serveIndex);
2626
app.use('/', express.static(config.wwwDir));
2727
app.use(`/${LOGGER_DIR}`, express.static(path.join(__dirname, '..', '..', 'bin'), { maxAge: 31536000 }));
28+
app.get(IONIC_LAB_URL, (req, res) =>
29+
res.sendfile('ionic-lab.html', {root: path.join(__dirname, '..', '..', 'bin')}));
2830
app.get('/cordova.js', serveCordovaJS);
2931

3032
if (config.useProxy) {

src/dev-server/serve-config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ export interface ServeConfig {
1515
useProxy: boolean;
1616
}
1717
export const LOGGER_DIR = '__ion-dev-server';
18-
export const IONIC_LAB_URL = `/${LOGGER_DIR}/ionic-lab.html`;
18+
export const IONIC_LAB_URL = '/ionic-lab';

0 commit comments

Comments
 (0)