Fix http-server on Windows
This commit is contained in:
@@ -81,16 +81,19 @@ function listen(port) {
|
||||
|
||||
var server = httpServer.createServer(options);
|
||||
server.listen(port, host, function() {
|
||||
var uri = [ssl ? 'https' : 'http', '://', host, ':', port].join('');
|
||||
var protocol = ssl ? 'https:' : 'http:';
|
||||
var canonical_host = host === "0.0.0.0" ? "localhost" : host;
|
||||
var uri = protocol + '//' + host + ':' + port;
|
||||
var canonical_uri = protocol + '//' + canonical_host + ':' + port;
|
||||
log('Starting up http-server, serving '.yellow
|
||||
+ server.root.cyan
|
||||
+ ((ssl) ? ' through'.yellow + ' https'.cyan : '')
|
||||
+ (ssl ? ' through'.yellow + ' https'.cyan : '')
|
||||
+ ' on: '.yellow
|
||||
+ uri.cyan);
|
||||
|
||||
log('Hit CTRL-C to stop the server');
|
||||
if (argv.o) {
|
||||
opener(uri);
|
||||
opener(canonical_uri);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user