next.js

can next js api endpoint be access from other app


I am developing a web app using react on Next js framework.I have created API route that components of the web app gets data from. Now I want to create a mobile app using can i use the same API endpoint to get data in the mobile app also.

I am using next js 13 latest app directory


Solution

  • Yes, all is same like you use express server. But if you want to use it for sensitive actions like authorized users, please use security options like API key or JWT token.