DEV Community

Discussion on: Adding an API and database to your Nuxt App with Prisma

Collapse
 
axelbriche profile image
AxelBriche • Edited

Is it possible to use prisma with Nuxt 3 and /server/api folder for useAsyncData/useFetch methods (for send form data) without Express?

I don't find find how to sent (PUT/POST) my form data with useAsyncData/useFetch.
And Nuxt 3 come with the /server/api dir, why use Express?

Collapse
 
gazreyn profile image
Gareth

This was almost a year ago so I'm pretty sure you worked it out between then and now.

Image description

And then you'd just call const { data } = await useFetch('/api/user/1'); in app.vue or which ever Vue component you'd like.

Collapse
 
ruheni profile image
Ruheni Alex

Hi Axel 👋🏽

At the time the guide was written, the sample application was using Nuxt 2 (I'll add a note about this). You can exclude Express in your project. You can still use Prisma with in server routes.

Collapse
 
albie214 profile image
Aldwin Filoteo

how can we fetch data from database without using Express ? can we have samples using nuxt 2 . thank you