Skip to content

Unable to get domain routes working #4598

Answered by RomainLanz
BenDavidson90 asked this question in Help
Discussion options

You must be logged in to vote

Hey @BenDavidson90! 👋🏻

Since you are using a domain, you have to specify the domain when generating the route.

Route
  .get('/users/:id', 'UsersController.show')
  .domain(':tenant.adonisjs.com')

// Make URL
const url = Route.makeUrl('UsersController.show', [1], {
  domain: ':tenant.adonisjs.com',
})

📚 https://v5-docs.adonisjs.com/guides/routing#lookup-inside-a-domain

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BenDavidson90
Comment options

Answer selected by BenDavidson90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants