Skip to content

Commit 81c41ab

Browse files
author
Ives van Hoorne
committed
Reset host check for codesandbox.dev
1 parent b8ec373 commit 81c41ab

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

scripts/start.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ var opn = require('opn');
1212
var http = require('http');
1313
var proxy = require('http-proxy-middleware');
1414
var httpProxy = require('http-proxy');
15-
var detect = require('detect-port');
1615
var prompt = require('./utils/prompt');
1716
var config = require('../config/webpack.config');
1817
var 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

Comments
 (0)