CORS on VPS
I deployed Novu on VPS. When I try to register through web app I get CORS error.
In network and console I get these (two images)
8 Replies
Hi @Kh. M-S., I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Others
* React Get Started
* API Overview
* SDKs & Client Libraries
-----------------------------
Answer
The CORS error you're encountering typically occurs because Novu's API is intended to be used from the server side. When you try to access it from a client-side application, such as a web browser, it will not allow requests due to security reasons (1) .
To resolve this, ensure that all API requests to Novu are being made from your server-side code. If you need to interact with the API from the client side, you should use Novu's client-side libraries instead, which are designed to handle such interactions properly.
For further details on handling CORS and configuring your server correctly, you can refer to Novu's official API documentation.
If the issue persists, double-check your server and web application configuration to ensure they align with Novu’s requirements and best practices. Make sure that your server is correctly setting the appropriate CORS headers if it's acting as a middleman between your web app and Novu's API.
Got it. Tagging @Support for additional help.
I do not understand. So when I deployed Novu localy I could go to Web APP (localhost:4200) and use it. Now when I deploy it on the VPS I can not use Web APP (ip-address:4200)?
@Kh. M-S., you just advanced to level 4!
@Kh. M-S.
It a humle request to have one support post for same issue 🙏🏻. you have created more than 4 posts for similar issue
@Pawan Jain I am sorry! It is my second post about CORS. And I will not create another one. My apologies! I hope I will find solution here
checkout this message
https://discord.com/channels/895029566685462578/1255140095674159254/1255145744374038639