Fork me on GitHub
#reitit
<
2018-03-02
>
grierson19:03:02

Does {:router r/segment-router} work with ring/router?

ikitommi21:03:31

All routers impls work with ring-router, but segment-router reorganizes the tree into a prefix-tree, which by definition can't handle conflicts. You have two options: 1) modify the tree not to contain conflicts (recommended) 2) disable the conflict resolution (e.g. just log the conflicts) and force a r/linear-router.

grierson21:03:17

Thank you for the reply. For option one , I can’t change the route tree as I am trying to follow this (Conduit API spec) [https://github.com/gothinkster/realworld/tree/master/api#feed-articles], unless there is someway around this in Reitit. So I just went with option 2 of just printing the conflicts and using linear-router. Thank you.

ikitommi21:03:27

actually, the 2 should work just by disabling the conflicts. reitit will do a :linear-router for as it's the only one that with that tree.

ikitommi21:03:17

if the conflict is removed, you would get a mixed-router proxying to single-static-path-router & segment-router.

ikitommi21:03:33

hope this helps

grierson21:03:17

Thank you for the reply. For option one , I can’t change the route tree as I am trying to follow this (Conduit API spec) [https://github.com/gothinkster/realworld/tree/master/api#feed-articles], unless there is someway around this in Reitit. So I just went with option 2 of just printing the conflicts and using linear-router. Thank you.