reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
abdullahibra 2020-07-13T08:36:04.227600Z

Hi everyone, 👆

abdullahibra 2020-07-13T08:37:38.228Z

the example i have mentioned is https://github.com/metosin/reitit/tree/master/examples/pedestal-swagger

abdullahibra 2020-07-13T13:05:16.230100Z

How can this simple example be improved to add better handling of invalid inputs?

jlmr 2020-07-13T15:58:34.232600Z

Hi, I’m setting up reitit with re-frame, basically following this example: https://github.com/metosin/reitit/blob/master/examples/frontend-re-frame/src/cljs/frontend_re_frame/core.cljs I’ve also setup the backend to serve index.html on all relevant matches. Navigating on the frontend side of things seems to work correctly, but how can I get it so that the frontend routing triggers when a user refreshes the page?

valtteri 2020-07-13T16:20:25.233800Z

Hi @jlmr! As far as I know it should just work. If you’re on http://localhost:3449/#/sub-page2 and refresh, it should print out to console > initializing routes > Entering sub-page 2

valtteri 2020-07-13T16:20:45.234100Z

Or did you expect something else? 😮

valtteri 2020-07-13T16:23:04.235800Z

You said you’re returning index.html on all relevant matches. Can you confirm that it’s actually returning index.html with the route you’re requesting?

valtteri 2020-07-13T16:24:44.236500Z

Are you trying with or without # in the url?

abdullahibra 2020-07-13T16:26:06.237Z

@valtteri can you help about my issue 🙂 ?

valtteri 2020-07-13T16:27:52.237900Z

Sorry @abdullahibra I don’t know Pedestal. 😕 But with a quick look it looks like you may have a bad version of Jackson pulled in and that might cause the 500 errors you’re seeing?

valtteri 2020-07-13T16:28:59.238600Z

(I remember vaguely that I had to pin Jackson dependencies to certain versions at some point but I thought this was fixed a long time ago…)

valtteri 2020-07-13T16:30:45.239Z

I might be completely wrong also.

abdullahibra 2020-07-13T16:31:06.239300Z

i just tried the example at https://github.com/metosin/reitit/tree/master/examples/pedestal-swagger

abdullahibra 2020-07-13T16:31:36.239600Z

@valtteri thank you

valtteri 2020-07-13T16:32:03.239800Z

I can give it a try…

abdullahibra 2020-07-13T16:38:38.240Z

sure

abdullahibra 2020-07-13T16:39:13.240700Z

for math post, just change x to string

valtteri 2020-07-13T16:41:08.241Z

Yeah, it gives the nasty 500

abdullahibra 2020-07-13T16:42:11.241400Z

it's working fine with http-swagger example, https://github.com/metosin/reitit/tree/master/examples/http-swagger

valtteri 2020-07-13T16:44:02.242500Z

When I run lein deps :tree | grep jackson I can see that some jackson deps have different version

[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.9.0"]
     [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.9.0"]
   [com.fasterxml.jackson.core/jackson-core "2.11.0"]
   [com.fasterxml.jackson.core/jackson-databind "2.11.0"]
     [com.fasterxml.jackson.core/jackson-annotations "2.11.0"]
       [com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.11.0"]

valtteri 2020-07-13T16:44:07.242700Z

This might cause issues

valtteri 2020-07-13T16:47:33.243200Z

But dunno.. I need to run now, but hope you get it fixed!

abdullahibra 2020-07-13T17:11:07.243500Z

Thank you 🙂

jlmr 2020-07-13T18:41:54.244400Z

@valtteri Thanks! I’m trying without the # and so far it doesn’t work unfortunately