Skip to content
Advertisement

How to pass params in Nuxt 3 server/api?

I can’t figure it out how to pass params to an anonymous function in Nuxt 3.

index.vue:

JavaScript

server/api/sign_up_news.js:

JavaScript

working:

JavaScript

Do you know how to pass parameter into Nuxt 3 server/api? Or do you got a source? The official docs are blank at this moment.

Advertisement

Answer

Use useBody

Its mention in the docs: https://v3.nuxtjs.org/guide/features/server-routes#handling-requests-with-body

you just need to read through

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement