Print http-server message, allow auto port finding starting at 3000

This commit is contained in:
Joshua Granick
2023-05-20 11:05:47 -07:00
parent 9cec64b34a
commit a90915cb3f
2 changed files with 18 additions and 15 deletions

View File

@@ -80,8 +80,13 @@ else if (colors) {
};
}
// CHANGE: Always show logger info
if (!logger) logger = {};
logger.info = console.log;
if (!port) {
portfinder.basePort = 8080;
// CHANGE: Start finding ports beginning at port 3000
portfinder.basePort = 3000;
portfinder.getPort(function (err, port) {
if (err) { throw err; }
listen(port);