diff --git a/lib/serve.js b/lib/serve.js index ef2e8e5..418be6b 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -15,15 +15,15 @@ module.exports = async (file, flags, restarting) => { process.emit('SIGUSR2') } + const handler = await getModule(file) + // And then load the files - const module = flags.silent - ? getModule(file) - : log(getModule(file), flags.limit) + const module = flags.silent ? handler : log(handler, flags.limit) const server = serve(module) const { isNaN } = Number let port = Number(flags.port) - + if (isNaN(port) || (!isNaN(port) && (port < 1 || port >= 2 ** 16))) { console.error(`Port option must be a number. Supplied: ${flags.port}`) process.exit(1) diff --git a/package.json b/package.json index 6557926..c484a0a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "get-port": "3.2.0", "ip": "1.1.5", "jsome": "2.3.26", - "micro": "9.0.2", + "micro": "9.1.0", "mri": "1.1.0", "pkg-up": "2.0.0", "pretty-error": "2.1.1",