Next.js Discord

Discord Forum

expose some API routes to mobile application?

Unanswered
Naeemgg posted this in #help-forum
Open in Discord
I have a mobile application exactly same as nextjs web application, so I'd like to use my existing nextjs backend and database. how can I achieve this?

3 Replies

Asian black bear
You just send requests to your public API accessible via route handlers.
@Asian black bear You just send requests to your public API accessible via route handlers.
currently I'm getting CORS issue from android application when I try to hit the api route
Roseate Spoonbill
@Naeemgg Next has great documentation on how to cover CORS in route handlers. They also have examples on different levels of integration, so definitely worth checking out here: https://nextjs.org/docs/app/building-your-application/routing/route-handlers#cors