Skip to content

Commit

Permalink
Add documentation for server.base-path
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Jan 23, 2025
1 parent c09a47a commit 06d9819
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/src/main/asciidoc/mp/jaxrs/jaxrs-applications.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@
include::{rootdir}/includes/mp.adoc[]
== Jakarta REST Applications
== Content
- <<Overview, Overview>>
- <<Discovery of REST Beans, Discovery of REST Beans>>
- <<Setting Application Path, Setting Application Path>>
- <<Access to Application Instances, Access to Application Instances>>
- <<Injection Managers in Helidon, Injection Managers in Helidon>>
== Overview
The Jakarta REST specification (formerly JAX-RS) defines the notion of an `Application`
subclass whose methods return resource and provider classes, singletons and properties. This is the
Expand Down
16 changes: 16 additions & 0 deletions docs/src/main/asciidoc/mp/server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,22 @@ server:
See xref:{rootdir}/config/io_helidon_webserver_staticcontent_StaticContentFeature.adoc[Static Content Feature Configuration Reference] for details. The only difference is that we set welcome file to `index.html` by default.
=== Re-direct root using `server.base-path`
To redirect requests for the root path (`/`) to another path you can use the `server.base-path` property:
[source,yaml]
----
server:
base-path: /static/index.html
----
For any HTTP request for `/` this will return a 301 with the `Location:` header set to the value of `server.base-path`.
This is often used with Static Content Support to serve a specific `index.html` when `/` is requested.
Note that this feature is not for setting a context root for applications. To configure alternate context roots see
see xref:jaxrs/jaxrs-applications.adoc#_setting_application_path[Setting Application Path].
=== Example configuration of routing
A full configuration example (YAML):
Expand Down

0 comments on commit 06d9819

Please sign in to comment.