Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create [...catch_all] route #210

Merged
merged 7 commits into from
Dec 10, 2024
Merged

Conversation

Valerioageno
Copy link
Member

@Valerioageno Valerioageno commented Dec 7, 2024

Context & Description

This PR adds the support for the [...catch_all] routes.

No changes to the existing user interactions.

The only internal thing changed is the endpoint to the data only API __tuono/data/* that removes the */data.json extension. This because axum doesn't accept any key after the * wildcard (doc)

The API does not change:

// test/[...catch_all].rs
#[tuono_lib::handler]
async fn catch_all_route_example(req: Request) -> Response {
  
    let value = req.params.get("catch_all").unwrap();

    println!("{value}");

    // ...
}

Closing ticket #209

@Valerioageno Valerioageno self-assigned this Dec 7, 2024
@Valerioageno Valerioageno added the enhancement New feature or request label Dec 7, 2024
@Valerioageno Valerioageno added this to the Allow API only tuono app milestone Dec 7, 2024
@Valerioageno Valerioageno linked an issue Dec 7, 2024 that may be closed by this pull request
@Valerioageno Valerioageno force-pushed the create-catch-all-route branch from 9d19e40 to 16cf112 Compare December 10, 2024 17:28
@Valerioageno Valerioageno force-pushed the create-catch-all-route branch from c703da5 to 3185b24 Compare December 10, 2024 18:20
@Valerioageno Valerioageno marked this pull request as ready for review December 10, 2024 18:30
@Valerioageno Valerioageno merged commit 8467506 into main Dec 10, 2024
10 checks passed
@Valerioageno Valerioageno deleted the create-catch-all-route branch December 10, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement the [...catch-all] route
1 participant