Skip to content

Commit

Permalink
Await the handler to be consistent with micro 9.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Jan 8, 2018
1 parent 804eeb1 commit 176b13e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/serve.js
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down

0 comments on commit 176b13e

Please sign in to comment.