Ayagikei / LifeUp-SDK

Provide LifeUp SDK, and expose LifeUp APIs as HTTP services!
22 stars 4 forks source link

Blocked by cors policy #10

Open n1ccc opened 5 days ago

n1ccc commented 5 days ago

Hi there,

i started to fetch the API Data using javascript to show daily tasks in a simple HTML File on my computer using my own styles.

My Problem is that its not possible because typical browser doesnt allow direct API use from local servers this way. It will be blocked using a cors policy for security reason.

There are some kind of workarounds like using a reverse Proxy but much easier and consistent can be to add the "Access-Control-Allow-Origin' to the header from the backend server.

Is that a possible option? Maybe you can implement it with a toggle option?

Let me know what you think about it.

Thank you anyway! Best wishes Nico

Ayagikei commented 4 days ago

Thank you for your feedback!

We will look into whether Ktor offers a ready-made solution and include it in the next version.

Additionally, we warmly welcome any pull requests from the community!