-
Notifications
You must be signed in to change notification settings - Fork 3k
Add a configuration to serve a local directory with a static handler Fix #39968 #51186
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! Your pull request does not follow our editorial rules. Could you have a look?
This message is automatically generated by a bot. |
dd79a29 to
2bc57dc
Compare
ia3andy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just cleaning non changed files
| HttpServerCommonHandlers.applyFilters(filtersInConfig, httpRouteRouter); | ||
| // Headers sent on any request, regardless of the response | ||
| HttpServerCommonHandlers.applyHeaders(httpConfig.header(), httpRouteRouter); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove those changes I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| */ | ||
| @ConfigDocSection | ||
| WebsocketServerConfig websocketServer(); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
...rtx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/LocalStaticResourcesConfig.java
Show resolved
Hide resolved
|
I also forgot, you need to add those files as watched for livereload |
9744cb6 to
691e79a
Compare
ii have added @ia3andy |
691e79a to
4a1de61
Compare
| return; | ||
| } | ||
|
|
||
| String normalizedDir = Path.of(dir).normalize().toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might need toAbsolutePath here, because AFAIK the watcher is using absolute path for non resources. Debug to be sure
Summary
This PR introduces support for serving static files from a local directory,
configurable via
quarkus.http.local-static-resources.*.New configuration
quarkus.http.local-static-resources.enabled=true
quarkus.http.local-static-resources.path=/local-static/
quarkus.http.local-static-resources.directory=local-static
Tests
Added
LocalStaticResourcesTestwhich verifies: