Hi all ! Quick question. I’m using reitit router on the frontend and the backend. How can I forward urls to the frontend router? I have routes which work like `/#/great/person` . However, when I navigate to that route using the browser, I’m redirected to `#/` instead of the route. (I posted on #beginners but someone recommended that I post here as well, hope that’s alright)
In the reitit.frontend.easy/start!
, there is a function which requires an on-navigate
function. In the on-navigate
function we need to include a second history
parameter. See https://github.com/metosin/reitit/issues/315
Is it possible to route based on type like string?, int? or a set of strings(enum)?
or maybe someone has a good idea about implementing these endpoints with reitit:
addEndpoint("GET", "/api/stacks/{orgName}/{projectName}/{stackName}/updates", "getStackUpdates")
addEndpoint("GET", "/api/stacks/{orgName}/{projectName}/{stackName}/updates/latest", "getLatestStackUpdate")
addEndpoint("GET", "/api/stacks/{orgName}/{projectName}/{stackName}/updates/{version}", "getStackUpdate")
addEndpoint("GET", "/api/stacks/{orgName}/{projectName}/{stackName}/updates/{version}/contents/files", "getUpdateContentsFiles")
addEndpoint("GET", "/api/stacks/{orgName}/{projectName}/{stackName}/updates/{version}/contents/file/{path:.*}", "getUpdateContentsFilePath")
addEndpoint("POST", "/api/stacks/{orgName}/{projectName}/{stackName}/destroy", "createDestroy")
addEndpoint("POST", "/api/stacks/{orgName}/{projectName}/{stackName}/preview", "createPreview")
addEndpoint("POST", "/api/stacks/{orgName}/{projectName}/{stackName}/update", "createUpdate")
addEndpoint("GET", "/api/stacks/{orgName}/{projectName}/{stackName}/{updateKind}/{updateID}", "getUpdateStatus")
addEndpoint("POST", "/api/stacks/{orgName}/{projectName}/{stackName}/{updateKind}/{updateID}", "startUpdate")
addEndpoint("PATCH", "/api/stacks/{orgName}/{projectName}/{stackName}/{updateKind}/{updateID}/checkpoint", "patchCheckpoint")
addEndpoint("POST", "/api/stacks/{orgName}/{projectName}/{stackName}/{updateKind}/{updateID}/complete", "completeUpdate")
addEndpoint("POST", "/api/stacks/{orgName}/{projectName}/{stackName}/{updateKind}/{updateID}/events", "postEngineEvent")
addEndpoint("POST", "/api/stacks/{orgName}/{projectName}/{stackName}/{updateKind}/{updateID}/events/batch", "postEngineEventBatch")
addEndpoint("POST", "/api/stacks/{orgName}/{projectName}/{stackName}/{updateKind}/{updateID}/renew_lease", "renewLease")
I mean I could write the routes for updates, destroy, preview and update individually but then I guess I have to do the same for all the endpoints with updateID
as well, right?
I could even do the catch all for the updates, destroy, preview and update and sort it out in the handler but I need a good swagger-spec, that's very important
ok, this is obvious now. Solved
mmh, no not solved, damn:(
there seems to be no way to solve this conflict. maybe with programmatically generated routes it would be feasible
but the conflict between /updates/:version
and /:update-kind/:update-id
persists
ok, so it works actually with inserting :conflicting true
, alright