Hey guys, does anyone what the syntax would be in ...
# kobweb
d
Hey guys, does anyone what the syntax would be in conf.yaml to allow multiple hosts in CORS. I tried the following but it doesn't work. Not really familiar with it
Copy code
server:
  cors:
    hosts:
      - name: "dieter.onrender.com"
        schemes:
          - "https"
      - name: "dieter.com"
        schemes:
          - "https"
c
Have you looked at this already? 😄 https://github.com/varabyte/kobweb?tab=readme-ov-file#configuring-cors And as far as I can see according to the actual source code, this what you have should suffice 🤔 Cors Host
d
yes 🙂. I don't need subdomains 🙂
Maybe my example isn't the best one. I"ll edit it
I'm hosting a kobweb project on render but it also needs to work on a custom domain
Just for test purposes i also tried the subdomains and it doesn't seem like they are working
d
Your syntax looks correct. I'm assuming you already saw my blog post which gets something running on render? https://bitspittle.dev/blog/2023/clouddeploy#configure-cors What error message are you seeing?
d
Yes I found the blogpost. My last changes are building on render now. Hopefully it will work
Any idea why the subdomains wouldn't work? I'm testing them in Paw at the moment with an "origin" field in the header
d
Did you spell it "subDomains" in the yaml? I think I did that because ktor separates "sub" and "domains" but looking at it now it should probably have been "sundomains" one word?
I'll add support for that
Otherwise you're making me guess a lot here 😛 putting code snippets and error messages would be really useful
d
Untitled
I did it like this
Screenshot 2023-12-29 at 18.31.56.png,Screenshot 2023-12-29 at 18.32.12.png
If you use
Copy code
subDomains:
It works
d
Ok so just a spelling "error" then
I'll update so "subdomains" also works in 0.15.4
🙌 1
❤️ 1
🔥 1
d
Maybe also add it to guide and readme of repo?
So other people find it quicker ? Should they be using an older version?
d
Ah wait I fixed this already
What version of Kobweb are you using?
Pretty sure I made this change in 0.15.3, thought i was going crazy for a second because I'm juggling a lot these days
d
I'm using 0.15.1. So it's a version that doesn't support new syntax
I was using this snippet from the readme.
d
You should upgrade to 0.15.3
d
But what I meant by adding it to the readme was that you could mention that versions before 0.15.3 need to use subDomain. Or you could mention something about upgrading to 0.15.3 if you want to use subdomains correctly.
d
Kobweb README is long enough without adding infinite histories to each section
Kobweb is still pre-1.0 so things should be considered a bit more fluid during this time
We are pretty careful for most features but yaml is hard because we can't tag things as deprecated
Best for users to keep up to date and ask questions if things aren't working for now
d
Ok! Just thought it would be easier for others to find the issue or the reason it's not working. Thanks for the help!! Everything is working great now!!
d
The only user who has ever asked about subdomains is you! It's a pretty niche feature. (And I'm glad you asked here about it)
Glad you're working. Post-1.0 we'll definitely be a lot more rigorous with the yaml.