Can be created /api folder in Nextjs - App Router?
Unanswered
Whimbrel posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
WhimbrelOP
Can be created /api folder in Nextjs - App Router?
20 Replies
![Avatar](https://cdn.discordapp.com/avatars/890486507872342027/cba9267c0173c6acfde7fa4ba0e70f94.webp?size=256)
Arinji
Yup, you can do that
Most of the time, the docs help out
https://nextjs.org/docs/app/building-your-application/routing/route-handlers
https://nextjs.org/docs/app/building-your-application/routing/route-handlers
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
WhimbrelOP
@Arinji, not sure why is not working...
![Image](https://cdn.discordapp.com/attachments/1165008946373853305/1165010686116642866/image.png?ex=65454bc0&is=6532d6c0&hm=90a306df012e94c27a82c44cad91580cac0e14e3b46b3ed7e6543b4360afbe28&)
![Avatar](https://cdn.discordapp.com/avatars/890486507872342027/cba9267c0173c6acfde7fa4ba0e70f94.webp?size=256)
Arinji
Read the docs please
You need to make a folder
Its folder routing
The file needs to be route.tsx
And the folder name will be the route name
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
WhimbrelOP
I have a folder called "api" and a file. I tasted also with route.ts, but still not working.
![Avatar](https://cdn.discordapp.com/avatars/890486507872342027/cba9267c0173c6acfde7fa4ba0e70f94.webp?size=256)
Arinji
Try the route.tsx and send the screenshot
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
WhimbrelOP
Ahh, gotcha
![Image](https://cdn.discordapp.com/attachments/1165008946373853305/1165011617084362863/image.png?ex=65454c9e&is=6532d79e&hm=251fe7e5d3854a5ba4454ea1a68a0c77535db8bec7d01298fbf4163ebe592986&)
So basically I need to call /api not api/route as it was before (Pages)
Hmm, that's tricky, what about if I want to have some other APIs in /api folder?
![Avatar](https://cdn.discordapp.com/avatars/890486507872342027/cba9267c0173c6acfde7fa4ba0e70f94.webp?size=256)
Arinji
Make a folder with the route name
So /api/users is a folder with the name users
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
WhimbrelOP
ah, gotcha
![Image](https://cdn.discordapp.com/attachments/1165008946373853305/1165012223064817795/image.png?ex=65454d2e&is=6532d82e&hm=db29ea497c29e23a1b213889e67973b30a9fe6394cf98eee6f8335e22fcd3dde&)
Make sense, and it's working.
Thank you!! Have a nice evening 😄