Skip to content

Commit

Permalink
v5 (#343)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drop support for NodeJS v14, v16

BREAKING CHANGE: drop `onUnhandledRequest` middleware option

BREAKING CHANGE: returns a 404 response for unknown routes

Co-authored-by: Baoshan Sheng <sheng@icmd.org>
Co-authored-by: wolfy1339 <4595477+wolfy1339@users.noreply.github.com>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
  • Loading branch information
4 people authored Jun 20, 2023
1 parent 581c098 commit 7a781c5
Show file tree
Hide file tree
Showing 17 changed files with 759 additions and 6,274 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ jobs:
strategy:
matrix:
node_version:
- 14
- 16
- 18
- 20
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node_version }}
Expand Down
75 changes: 0 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -950,31 +950,6 @@ All exposed paths will be prefixed with the provided prefix. Defaults to `"/api/

</td>
</tr>
<tr>
<th>
<code>options.onUnhandledRequest</code> __deprecated__
</th>
<th>
<code>function</code>
</th>
<td>

Defaults to

```js
function onUnhandledRequest(request, response) {
response.writeHead(404, {
"content-type": "application/json",
});
response.end(
JSON.stringify({
error: `Unknown route: ${request.method} ${request.url}`,
})
);
}
```

</td></tr>
</tbody>
</table>

Expand Down Expand Up @@ -1038,31 +1013,6 @@ addEventListener("fetch", (event) => {

All exposed paths will be prefixed with the provided prefix. Defaults to `"/api/github/oauth"`

</td>
</tr>
<tr>
<th>
<code>options.onUnhandledRequest</code> __deprecated__
</th>
<th>
<code>function</code>
</th>
<td>Defaults to

```js
function onUnhandledRequest(request) {
return new Response(
JSON.stringify({
error: `Unknown route: ${request.method} ${request.url}`,
}),
{
status: 404,
headers: { "content-type": "application/json" },
}
);
}
```

</td>
</tr>
</tbody>
Expand Down Expand Up @@ -1128,31 +1078,6 @@ export const handler = createAWSLambdaAPIGatewayV2Handler(app, {

All exposed paths will be prefixed with the provided prefix. Defaults to `"/api/github/oauth"`

</td>
</tr>
<tr>
<th>
<code>options.onUnhandledRequest</code> __deprecated__
</th>
<th>
<code>function</code>
</th>
<td>Defaults to returns:

```js
function onUnhandledRequest(request) {
return
{
status: 404,
headers: { "content-type": "application/json" },
body: JSON.stringify({
error: `Unknown route: [METHOD] [URL]`,
})
}
);
}
```

</td>
</tr>
</tbody>
Expand Down
Loading

0 comments on commit 7a781c5

Please sign in to comment.