Skip to content
Open
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
15 changes: 15 additions & 0 deletions content/docs/basics/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,21 @@ router
})
```

### Registering API only routes of a group

You can use the `group.apiOnly` to apply `apiOnly` on all its resources.

See also: [Registering API only routes](controllers.md#registering-api-only-routes)


```ts
// title: start/routes.ts
router.group(() => {
router.resource('posts', PostsController)
router.resource('user', UsersController)
}).apiOnly()
```

## Registering routes for a specific domain

AdonisJS allows you to register routes under a specific domain name. This is helpful when you have an application mapped to multiple domains and want different routes for each domain.
Expand Down