Skip to content

Commit

Permalink
feat(http2): add HTTP/2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Marton authored and hekike committed Oct 27, 2017
1 parent 0e19c0e commit ee2092f
Show file tree
Hide file tree
Showing 15 changed files with 2,206 additions and 1,511 deletions.
16 changes: 8 additions & 8 deletions docs/_api/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Otherwise the given type is matched by an exact match, and then subtypes.

**Examples**

_You may pass the subtype such as html which is then converted internally to
text/html using the mime lookup table:_
_You may pass the subtype such as html which is then converted internally
to text/html using the mime lookup table:_

```javascript
// Accept: text/html
Expand Down Expand Up @@ -95,8 +95,8 @@ Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer

### getContentType

Returns the value of the content-type header. If a content-type is not set,
this will return a default value of `application/octet-stream`
Returns the value of the content-type header. If a content-type is not
set, this will return a default value of `application/octet-stream`

Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**

Expand Down Expand Up @@ -300,8 +300,8 @@ Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
Start the timer for a request handler.
By default, restify uses calls this automatically for all handlers
registered in your handler chain.
However, this can be called manually for nested functions inside the handler
chain to record timing information.
However, this can be called manually for nested functions inside the
handler chain to record timing information.

**Parameters**

Expand All @@ -310,8 +310,8 @@ chain to record timing information.
**Examples**

_You must explicitly invoke
endHandlerTimer() after invoking this function. Otherwise timing information
will be inaccurate._
endHandlerTimer() after invoking this function. Otherwise timing
information will be inaccurate._

```javascript
server.get('/', function fooHandler(req, res, next) {
Expand Down
29 changes: 16 additions & 13 deletions docs/_api/response.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ formatter based on the `content-type` header.

_You can use send() to wrap up all the usual writeHead(), write(), end()
calls on the HTTP API of node.
You can pass send either a `code` and `body`, or just a body. body can be an
`Object`, a `Buffer`, or an `Error`.
When you call `send()`, restify figures out how to format the response based
on the `content-type`._
You can pass send either a `code` and `body`, or just a body. body can be
an `Object`, a `Buffer`, or an `Error`.
When you call `send()`, restify figures out how to format the response
based on the `content-type`._

```javascript
res.send({hello: 'world'});
Expand All @@ -169,8 +169,8 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer

### sendRaw

Like `res.send()`, but skips formatting. This can be useful when the payload
has already been preformatted.
Like `res.send()`, but skips formatting. This can be useful when the
payload has already been preformatted.
Sends the response object. pass through to internal `__send` that skips
formatters entirely and sends the content as is.

Expand All @@ -189,7 +189,8 @@ Uses `header()` underneath the hood, enabling multi-value headers.

**Parameters**

- `name` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** name of the header or `Object` of headers
- `name` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** name of the header or
`Object` of headers
- `val` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** value of the header

**Examples**
Expand Down Expand Up @@ -236,13 +237,15 @@ Redirect is sugar method for redirecting.
- `options.hostname` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's hostname
- `options.pathname` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's pathname
- `options.port` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's port number
- `options.query` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's query string parameters
- `options.overrideQuery` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** if true, `options.query` stomps over
any existing query parameters on current URL.
by default, will merge the two.
- `options.query` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's query string
parameters
- `options.overrideQuery` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** if true, `options.query`
stomps over any existing query
parameters on current URL.
by default, will merge the two.
- `options.permanent` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** if true, sets 301. defaults to 302.
- `next` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** mandatory, to complete the response and trigger audit
logger.
- `next` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** mandatory, to complete the response and trigger
audit logger.

**Examples**

Expand Down
3 changes: 3 additions & 0 deletions docs/_api/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ Creates a new Server.
response header, default is `restify`. Pass empty string to unset the header. (optional, default `false`)
- `options.spdy` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by
[node-spdy](https://github.com/indutny/node-spdy).
- `options.http2` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by
[http2.createSecureServer]\(<https://nodejs.org/api/http2.html>
\#http2_http2_createsecureserver_options_onrequesthandler).
- `options.handleUpgrades` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Hook the `upgrade` event
from the node HTTP server, pushing `Connection: Upgrade` requests through the
regular request handling chain. (optional, default `false`)
Expand Down
Loading

0 comments on commit ee2092f

Please sign in to comment.