#NextJs api calls

36 messages · Page 1 of 1 (latest)

lilac siren
#

hello everyone , im loving tauri so far ive built my app now the app using nextjs and it has api folder which makes calls on a certin clicks by the user now in dev mode everything works fine the call goes throw and i get a response now once i built it there is no api calls or anything its like a static app that is offline and dosent make any calls , how can i solve this?

cinder swift
#

So you have to consider using NextJS but in a non-ssr way ig

lilac siren
#

is there a tutroial or a guide i couldnt find any

lilac siren
cinder swift
#

I’ve found this

#

And u got plenty of ressources on Google if you type « nextJs Tauri »

lilac siren
#

thank you man appreciate it , i wouldn't ask if i have found anything close to what im looking for there is no video or blog about making api calls with nextjs and tauri

cinder swift
#

What u mean by api calls ?

lilac siren
cinder swift
#

Http request ?

lilac siren
cinder swift
#

Sure

lilac siren
#

this is an api file for nextjs

#

like a normal web app

#

if i built this with tauri it wouldnt work

cinder swift
#

It’s for SSR

#

You need to do SSG

#

In dev you have node running

lilac siren
#

but if i do ssg it wouldn't be live would it ? i have a chat gpt like model that the user asks a question and the bot response so it need to be live the tauri app dosent seem to connect to the internet

cinder swift
#

In build you don’t have shit

lilac siren
cinder swift
#

You could buuut again that would kill tauri’s purpose

#

And adds some security issues ig

#

If you want to make requests you can either use the js http api that Tauri provides

#

Or use the rust backend to make those

lilac siren
cinder swift
#

If you’re familiar with axios

#

You can use the Tauri adapter

lilac siren
#

thanks alot man i will try this

cinder swift
lilac siren
#

❤️ tyy