Skip to content

Commit

Permalink
feat: support passing no parameters to app.listen()
Browse files Browse the repository at this point in the history
  • Loading branch information
asos-craigmorten committed May 29, 2020
1 parent e0766b3 commit 978aab8
Show file tree
Hide file tree
Showing 55 changed files with 557 additions and 484 deletions.
4 changes: 2 additions & 2 deletions .github/API/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,9 @@ app.listen = function (options) {
};
```

#### app.listen(port, [callback])
#### app.listen([port], [callback])

Binds and listens for connections on the specified numerical port. This method is nearly identical to Deno's [http.listenAndServe()](https://doc.deno.land/https/deno.land/std/http/server.ts#listenAndServe).
Binds and listens for connections on the specified numerical port. If no port is provided, an available port is assigned for you. This method is similar to Deno's [http.listenAndServe()](https://doc.deno.land/https/deno.land/std/http/server.ts#listenAndServe).

This method is supported for legacy reasons to aid in transitions from Express on Node.

Expand Down
4 changes: 4 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## [0.7.0] - 29-05-2020

- feat: support passing no parameters to `app.listen()` and being automatically assigned a port.

## [0.6.3] - 29-05-2020

- fix: set versions on all deps to prevent adopting breaking changes from `master`.
Expand Down
54 changes: 27 additions & 27 deletions docs/classes/_response_.response.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h3>app</h3>
<div class="tsd-signature tsd-kind-icon">app<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_types_.application.html" class="tsd-signature-type">Application</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L34">response.ts:34</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L34">response.ts:34</a></li>
</ul>
</aside>
</section>
Expand All @@ -150,7 +150,7 @@ <h3>body</h3>
<div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <a href="../modules/_types_.html#denoresponsebody" class="tsd-signature-type">DenoResponseBody</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L33">response.ts:33</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L33">response.ts:33</a></li>
</ul>
</aside>
</section>
Expand All @@ -160,7 +160,7 @@ <h3>headers</h3>
<div class="tsd-signature tsd-kind-icon">headers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Headers</span><span class="tsd-signature-symbol"> = new Headers()</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L32">response.ts:32</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L32">response.ts:32</a></li>
</ul>
</aside>
</section>
Expand All @@ -170,7 +170,7 @@ <h3>locals</h3>
<div class="tsd-signature tsd-kind-icon">locals<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L36">response.ts:36</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L36">response.ts:36</a></li>
</ul>
</aside>
</section>
Expand All @@ -180,7 +180,7 @@ <h3>req</h3>
<div class="tsd-signature tsd-kind-icon">req<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_types_.request.html" class="tsd-signature-type">Request</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L35">response.ts:35</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L35">response.ts:35</a></li>
</ul>
</aside>
</section>
Expand All @@ -190,7 +190,7 @@ <h3>status</h3>
<div class="tsd-signature tsd-kind-icon">status<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Status</span><span class="tsd-signature-symbol"> = 200</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L31">response.ts:31</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L31">response.ts:31</a></li>
</ul>
</aside>
</section>
Expand All @@ -207,7 +207,7 @@ <h3>append</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L52">response.ts:52</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L52">response.ts:52</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -242,7 +242,7 @@ <h3>attachment</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L65">response.ts:65</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L65">response.ts:65</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -271,7 +271,7 @@ <h3>clear<wbr>Cookie</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L106">response.ts:106</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L106">response.ts:106</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -300,7 +300,7 @@ <h3>cookie</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L88">response.ts:88</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L88">response.ts:88</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -332,7 +332,7 @@ <h3>download</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L130">response.ts:130</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L130">response.ts:130</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -368,7 +368,7 @@ <h3>end</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L155">response.ts:155</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L155">response.ts:155</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -396,7 +396,7 @@ <h3>etag</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L172">response.ts:172</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L172">response.ts:172</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -425,7 +425,7 @@ <h3>format</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L242">response.ts:242</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L242">response.ts:242</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -493,7 +493,7 @@ <h3>get</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L277">response.ts:277</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L277">response.ts:277</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -522,7 +522,7 @@ <h3>json</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L293">response.ts:293</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L293">response.ts:293</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -554,7 +554,7 @@ <h3>jsonp</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L319">response.ts:319</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L319">response.ts:319</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -586,7 +586,7 @@ <h3>links</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L369">response.ts:369</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L369">response.ts:369</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -620,7 +620,7 @@ <h3>location</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L399">response.ts:399</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L399">response.ts:399</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -655,7 +655,7 @@ <h3>send</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L422">response.ts:422</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L422">response.ts:422</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -687,7 +687,7 @@ <h3>send<wbr>File</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L498">response.ts:498</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L498">response.ts:498</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -716,7 +716,7 @@ <h3>send<wbr>Status</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L529">response.ts:529</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L529">response.ts:529</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -750,7 +750,7 @@ <h3>set</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L553">response.ts:553</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L553">response.ts:553</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -785,7 +785,7 @@ <h3>set<wbr>Status</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L575">response.ts:575</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L575">response.ts:575</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -816,7 +816,7 @@ <h3>type</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L596">response.ts:596</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L596">response.ts:596</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -851,7 +851,7 @@ <h3>unset</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L609">response.ts:609</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L609">response.ts:609</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -880,7 +880,7 @@ <h3>vary</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/916ad4f/src/response.ts#L623">response.ts:623</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/091a1d0/src/response.ts#L623">response.ts:623</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
Loading

0 comments on commit 978aab8

Please sign in to comment.