Replies: 2 comments 6 replies
-
Route.get('/', () => {
/** JSON response */
return { page: 'home' }
}) or Route.get('/', ({ response }) => {
response.json(someObj)
}) or Route.get('/', ({ response }) => {
response.send({ foo: 'bar' })
}) https://docs.adonisjs.com/guides/response#sending-the-response |
Beta Was this translation helpful? Give feedback.
4 replies
-
Hey @hugoaboud! 👋 You can still use the Content Negotiation. Simply create a middleware that set the
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building an API that must be compatible (for now) with some of our legacy API standards, such as the
.json
suffix on CRUD routes.I've found the legacy solution, however I wasn't able to find it on v5 neither on the discussions/issues.
What is the recommended way to approach that on the new version?
Beta Was this translation helpful? Give feedback.
All reactions