@@ -12,7 +12,6 @@ var opn = require('opn');
1212var http = require ( 'http' ) ;
1313var proxy = require ( 'http-proxy-middleware' ) ;
1414var httpProxy = require ( 'http-proxy' ) ;
15- var detect = require ( 'detect-port' ) ;
1615var prompt = require ( './utils/prompt' ) ;
1716var config = require ( '../config/webpack.config' ) ;
1817var paths = require ( '../config/paths' ) ;
@@ -213,7 +212,8 @@ function runDevServer(port, protocol, index) {
213212 // Enable HTTPS if the HTTPS environment variable is set to 'true'
214213 https : protocol === 'https' ,
215214 // 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
217217 } ) ;
218218
219219 // Our custom middleware proxies requests to /index.html or a remote API.
@@ -253,22 +253,4 @@ function run(port) {
253253 }
254254}
255255
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