Closed DAlba-sudo closed 1 year ago
May be a duplicate #254.
Thank you for the nice comment. I'm glad you're finding the experience with Kobweb overall enjoyable.
CORS is a PITA. It is currently configurable in the .kobweb/conf.yaml
file. Take a look at my blog post for a concrete example: https://bitspittle.dev/blog/2023/clouddeploy#configure-cors
For more details about the conf.yaml
configuration values, see these related lines:
If it is a CORS issue, you should hopefully have access to your server logs to get more information about what's going on. They can be found in .kobweb/server/logs/kobweb-server.log
. You may need to configure the logging level to TRACE (which I actually temporarily made the default in 0.13.9 but later learned that was the wrong call, and am going to move back to DEBUG in 0.13.10)
Feature Request
I have spent most of my time under a rock, and found myself going away from my usual frameworks/languages. This is truly a beautiful library you've written.
I am an avid chrome extension developer and I was hoping to use your library's simplified API Streaming library in conjunction with a chrome extension for a personal project. That said, it seems that the extension is not being allowed to connect. Here's a summary of the issue, what I've tried, and my hypothesis - for what it's worth.
Issue: Chrome extension websocket connection to an API endpoint is not connecting when the request is made from a different origin. Hypothesis: I believe this may be due to existing CORS policies, most likely due to the KTOR library (take with a grain of salt though, not well versed in either KTOR or Kobweb).
Potential Solutions
I can see that there is a Server.class file that is being generated.
If there was a way to publicly add hosts to whatever is being fed into the constructor of the Cors class, that would be amazing!
I would love to help out with this by the way - if you (or anyone that might know how to help) have a lot on your plate. Just need a bit of guidance as to where to start digging, and if this is a KTOR issue that can be configured by downloading the KTOR library.