Fork me on GitHub
#luminus
<
2019-02-12
>
macrobartfast18:02:26

I am am using luminus with swagger; how do I enable CORS for local development?

macrobartfast18:02:45

I have tried wrap-cors in the handler but it is not working.

macrobartfast18:02:01

I also tried it in the middleware file, but in either case I'm doing it wrong.

macrobartfast18:02:19

I wonder if cors is allowed somewhere already and enabled with a flag or something.

Frank Henard18:02:47

@macrobartfast I'm not in clojurians very much, but my recommendation would be to post the code that you've tried, like one would do in a Stack Overflow question. In fact, many times I write my questions in SO, and maybe post the link in Clojurians.

macrobartfast19:02:13

I've always wondered if it's ok to crosspost like that.

Frank Henard19:02:19

hmm. Maybe not. I've never been yelled at, but I don't do it that often

macrobartfast20:02:30

I'm not confident enough in my knowledge to say this... but... could it be true that luminus has no cors support??

macrobartfast20:02:07

it has so much built in that it seems odd.

Frank Henard20:02:33

My understanding of luminus is that the bulk of it is leiningen templating that stitches together other popular Clojure web-app development libraries. If CORS support is offered for Ring, then it should be offered for luminus. Have you tried searching for CORS support for Ring?

macrobartfast20:02:02

I did... the solution is the wrap-cors middleware, which I've used successfully in the past but with luminus there are more layers than I'm familiar with with things like mount, so it's not working so far.

macrobartfast20:02:24

really, just my lack of knowledge for how the various parts play together.

macrobartfast20:02:08

I would have just thought folks would have been hitting their endpoints so often from luminous served apps that they would be needing cors out of the box.

macrobartfast20:02:10

but what's strange is that all the permutations of searching for variants on 'adding cors to luminus with swagger' and so on isn't finding anything useful.

Frank Henard20:02:39

sorry I couldn't be more help!

macrobartfast20:02:57

not a problem, and thanks for being supportive!

Frank Henard20:02:32

if you find a solution, post in here and tag me. I'm interested