Next.js Discord

Discord Forum

folder structure/best practices

Answered
Standard Chinchilla posted this in #help-forum
Open in Discord
Standard ChinchillaOP
yo, i have a next app and i would like to know where should i store my API calls? like what is the best folder structure/best practice

the idea is just have a file where i have all api requests and then i export the content i got from the api
Answered by Madeiran sardinella
Unfortunately react is absolutely agnostic to app scaffolding, but... You can create a services dir and put your API call into it. You can also separate in files depending on the resource that you are requesting, eg products, users, etc...
View full answer

7 Replies

Madeiran sardinella
Unfortunately react is absolutely agnostic to app scaffolding, but... You can create a services dir and put your API call into it. You can also separate in files depending on the resource that you are requesting, eg products, users, etc...
Answer
@Standard Chinchilla solved?
@B33fb0n3 <@1221617444531998810> solved?
Standard ChinchillaOP
yes, thank you
@Standard Chinchilla yes, thank you
sure thing. Please mark solution
@joulev