Skip to content

Commit

Permalink
docs: Add documentation for migrating TypeScript Express exports (#3239)
Browse files Browse the repository at this point in the history
daffl authored Jul 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 01a0374 commit bcaddea
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions docs/guides/migrating.md
Original file line number Diff line number Diff line change
@@ -116,20 +116,42 @@ The Express `rest` adapter now needs to be configured in the correct order, usua

The import of `feathers` has changed from

```js
```ts
const feathers = require('@feathersjs/feathers')

import feathers from '@feathersjs/feathers'
```

To

```js
```ts
const { feathers } = require('@feathersjs/feathers')

import { feathers } from '@feathersjs/feathers'
```

The Express exports for TypeScript have changed from

```ts
import express from '@feathersjs/express'

app.use(express.json())
app.use(express.urlencoded())
app.use(express.notFound())
app.use(express.errorHandler())
```

To

```ts
import express, { json, urlencoded, notFound, errorHandler } from '@feathersjs/express'

app.use(json())
app.use(urlencoded())
app.use(notFound())
app.use(errorHandler())
```

### Custom Filters & Operators

<BlockQuote type="warning" label="pending">

0 comments on commit bcaddea

Please sign in to comment.