Skip to content

Commit

Permalink
Merge pull request #76 from silverwind/listen-1-arg
Browse files Browse the repository at this point in the history
support single argument to .start
  • Loading branch information
jkyberneees authored Mar 27, 2020
2 parents 660cb89 + 2a7fa93 commit db83d45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ module.exports = (options = {}) => {
router.lookup(req, res)
},

start: (port = 3000, host) => new Promise((resolve, reject) => {
server.listen(port, host, (err) => {
start: (...args) => new Promise((resolve, reject) => {
if (!args || !args.length) args = [3000]
server.listen(...args, (err) => {
if (err) reject(err)
resolve(server)
})
Expand Down

0 comments on commit db83d45

Please sign in to comment.