pedestal

simongray 2024-11-22T09:56:28.233209Z

Pedestal is not responding to preflight OPTIONS requests? I am deep in some development machine CORS issues and it seems like I need to explicitly create OPTIONS variants for every single API route? I don't remember needing to do this before...

souenzzo 2024-11-22T10:08:37.992229Z

Add ::http/allowed-origins (fn [origin] (contains? #{"localhost"} origin)) to your service map

2024-11-22T10:38:30.179019Z

See http://pedestal.io/api/0.6/io.pedestal.http.cors.html for additional options including methods (Defaults to “GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS”)

simongray 2024-11-22T10:40:27.056679Z

Thanks… for some reason I had ::http/allow-origins in my service map, not allowed. Stupid mistake.

simongray 2024-11-22T10:42:46.565399Z

… but aren’t they always? The bugs you spend the longest time on are always the dumbest little things…

2024-11-22T10:52:58.256819Z

Does your editor use LSP? Just enable the experimental clj-kondo option "warn-if-keyword-is-used-which-isnt-mentioned-in-the-corresponding-readme"

simongray 2024-11-22T10:58:20.661869Z

I use IntelliJ, so I don’t think that’s an option?

simongray 2024-11-22T10:58:35.094349Z

clever solution, though.

souenzzo 2024-11-22T11:07:33.409309Z

My tip is never write a keyword. Always copy/paste.

hlship 2024-11-22T16:15:00.626509Z

I think the dizzying number of options in the service map is undesirable. I’ve been noodling in the background about what would be better.