Skip to content

Commit 766394d

Browse files
authored
fix(serve): communicate that ng serve is not secure. (#3646)
People are using it in production environment and should not.
1 parent db4e024 commit 766394d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/angular-cli/tasks/serve-webpack.ts

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ServeTaskOptions } from '../commands/serve';
1111
import { CliConfig } from '../models/config';
1212
import { oneLine } from 'common-tags';
1313
import * as url from 'url';
14+
import {stripIndents} from 'common-tags';
1415
const opn = require('opn');
1516

1617
export default Task.extend({
@@ -109,6 +110,17 @@ export default Task.extend({
109110

110111
webpackDevServerConfiguration.hot = serveTaskOptions.hmr;
111112

113+
if (serveTaskOptions.target === 'production') {
114+
ui.writeLine(chalk.red(stripIndents`
115+
****************************************************************************************
116+
This is a simple server for use in testing or debugging Angular applications locally.
117+
It hasn't been reviewed for security issues.
118+
119+
DON'T USE IT FOR PRODUCTION USE!
120+
****************************************************************************************
121+
`));
122+
}
123+
112124
ui.writeLine(chalk.green(oneLine`
113125
**
114126
NG Live Development Server is running on

0 commit comments

Comments
 (0)