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

Add a use of route_service with ServeFile to the static-file-server example #2361

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

uckelman
Copy link
Contributor

Motivation

The docs for Router::route_service give an example of using ServeFile, but if you come to the static file server example first, you won't necessarily be aware of route_service.

Solution

This PR adds an example using route_service, to make it easier to spot for people interested in serving static files.

@davidpdrsn
Copy link
Member

Looks good but you have to run cargo fmt

@uckelman
Copy link
Contributor Author

Huh, I'm surprised it wants that all on one line.

@davidpdrsn davidpdrsn merged commit 2e963ce into tokio-rs:main Nov 27, 2023
18 checks passed
@uckelman uckelman deleted the static-file-example-route_service branch November 27, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants