@@ -12,7 +12,6 @@ var opn = require('opn');
12
12
var http = require ( 'http' ) ;
13
13
var proxy = require ( 'http-proxy-middleware' ) ;
14
14
var httpProxy = require ( 'http-proxy' ) ;
15
- var detect = require ( 'detect-port' ) ;
16
15
var prompt = require ( './utils/prompt' ) ;
17
16
var config = require ( '../config/webpack.config' ) ;
18
17
var paths = require ( '../config/paths' ) ;
@@ -213,7 +212,8 @@ function runDevServer(port, protocol, index) {
213
212
// Enable HTTPS if the HTTPS environment variable is set to 'true'
214
213
https : protocol === 'https' ,
215
214
// contentBase: paths.staticPath,
216
- host : process . env . LOCAL_SERVER ? 'localhost' : 'codesandbox.dev'
215
+ host : process . env . LOCAL_SERVER ? 'localhost' : 'codesandbox.dev' ,
216
+ disableHostCheck : ! process . env . LOCAL_SERVER
217
217
} ) ;
218
218
219
219
// Our custom middleware proxies requests to /index.html or a remote API.
@@ -253,22 +253,4 @@ function run(port) {
253
253
}
254
254
}
255
255
256
- // We attempt to use the default port but if it is busy, we offer the user to
257
- // run on a different port. `detect()` Promise resolves to the next free port.
258
- detect ( DEFAULT_PORT ) . then ( port => {
259
- if ( port === DEFAULT_PORT ) {
260
- run ( port ) ;
261
- return ;
262
- }
263
-
264
- clearConsole ( ) ;
265
- var question =
266
- chalk . yellow ( 'Something is already running on port ' + DEFAULT_PORT + '.' ) +
267
- '\n\nWould you like to run the app on another port instead?' ;
268
-
269
- prompt ( question , true ) . then ( shouldChangePort => {
270
- if ( shouldChangePort ) {
271
- run ( port ) ;
272
- }
273
- } ) ;
274
- } ) ;
256
+ run ( DEFAULT_PORT ) ;
0 commit comments