Call API requests from frontend instead of backend

Is it possible to call API requests from frontend (using React) instead of backend (NextJS)?
If I call in from client-side I am getting CORS errors.

I simply want to have a button for creating new meeting (call API endpoint /users/:userId/meetings).

Right now I am using NextJS getServerSideProps method to call API for getting tokens, then another API call with retrieved token for creating a meeting. It works, but because it is server-side rendered, API calls can not be triggered after click on some button.

Also I am wondering about case - when some user clicks on button, it creates new access token and in exact same time some other users do the same, so second user overwrite access token and the first one user will not be able to create meeting, because it will throw an error.

Thanks

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.