Skip to content

Commit

Permalink
support PORT environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Heslip committed Jan 4, 2017
1 parent 440dc5f commit 93c2683
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -43,6 +43,12 @@ To run the microservice on port `3000` and localhost instead of listening on eve
$ micro -p 3000 -H localhost sleep.js
```

`micro` also supports using the `PORT` environment variable to set the port:

```bash
$ PORT=3000 micro sleep.js
```

## Usage

**Note**: `micro` requires Node `6.0.0` or later
Expand Down
2 changes: 1 addition & 1 deletion bin/micro
Expand Up @@ -19,7 +19,7 @@ const args = parse(process.argv, {
boolean: ['h'],
default: {
H: '0.0.0.0',
p: 3000
p: process.env.PORT || 3000
}
})
let [,, file] = args._;
Expand Down

0 comments on commit 93c2683

Please sign in to comment.