Skip to content

nest and route behaviour #568

Answered by jplatte
ghost asked this question in Q&A
Nov 26, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

If you don't need any sub-routes of the form /graphql/foo and want both /graphql and /graphql/ to work without redirects, I think that would just be

Router::new()
    .route("/graphql", post(graphql_handler))
    .route("/graphql/", post(graphql_handler))

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@davidpdrsn
Comment options

@ghost
Comment options

Answer selected by davidpdrsn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #567 on November 26, 2021 14:31.