Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docusaurus/docs/cms/backend-customization/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ In the following example, the custom routes file name is prefixed with `01-` to
<TabItem value="js" label="JavaScript">

```js title="./src/api/restaurant/routes/01-custom-restaurant.js"

module.exports = {
/** @type {import('@strapi/strapi').Core.RouterConfig} */
const config = {
type: 'content-api',
routes: [
{ // Path defined with an URL parameter
method: 'POST',
Expand All @@ -224,15 +225,19 @@ module.exports = {
}
]
}

module.exports = config
```

</TabItem>

<TabItem value="ts" label="TypeScript">

```js title="./src/api/restaurant/routes/01-custom-restaurant.ts"
import type { Core } from '@strapi/strapi';

export default {
const config: Core.RouterConfig = {
type: 'content-api',
routes: [
{ // Path defined with a URL parameter
method: 'GET',
Expand All @@ -246,6 +251,8 @@ export default {
}
]
}

export default config
```

</TabItem>
Expand Down
13 changes: 10 additions & 3 deletions docusaurus/static/llms-code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13372,8 +13372,9 @@ Language: JavaScript
File path: ./src/api/restaurant/routes/01-custom-restaurant.js

```js

module.exports = {
/** @type {import('@strapi/strapi').Core.RouterConfig} */
const config = {
type: 'content-api',
routes: [
{ // Path defined with an URL parameter
method: 'POST',
Expand All @@ -13387,15 +13388,19 @@ module.exports = {
}
]
}

module.exports = config
```

---
Language: TypeScript
File path: ./src/api/restaurant/routes/01-custom-restaurant.ts

```ts
import type { Core } from '@strapi/strapi';

export default {
const config: Core.RouterConfig = {
type: 'content-api',
routes: [
{ // Path defined with a URL parameter
method: 'GET',
Expand All @@ -13409,6 +13414,8 @@ export default {
}
]
}

export default config
```


Expand Down