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

Commit

Permalink
feat(serve): add '/ionic-lab' as an alias for the lab html file path.
Browse files Browse the repository at this point in the history
  • Loading branch information
jthoms1 committed Nov 17, 2016
1 parent 4d6bbd5 commit c319404
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/dev-server/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/dev-server/serve-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit c319404

Please sign in to comment.