From 06d9819a8da766f99aedfd4cffa3c1d3617f255b Mon Sep 17 00:00:00 2001 From: Joe Di Pol Date: Wed, 22 Jan 2025 16:04:32 -0800 Subject: [PATCH] Add documentation for server.base-path --- .../asciidoc/mp/jaxrs/jaxrs-applications.adoc | 10 +++++++++- docs/src/main/asciidoc/mp/server.adoc | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/mp/jaxrs/jaxrs-applications.adoc b/docs/src/main/asciidoc/mp/jaxrs/jaxrs-applications.adoc index cebce310e61..3f7c4638dff 100644 --- a/docs/src/main/asciidoc/mp/jaxrs/jaxrs-applications.adoc +++ b/docs/src/main/asciidoc/mp/jaxrs/jaxrs-applications.adoc @@ -23,7 +23,15 @@ include::{rootdir}/includes/mp.adoc[] -== Jakarta REST Applications +== Content + +- <> +- <> +- <> +- <> +- <> + +== 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 diff --git a/docs/src/main/asciidoc/mp/server.adoc b/docs/src/main/asciidoc/mp/server.adoc index 0cd3a31d304..c31f6e0a2f1 100644 --- a/docs/src/main/asciidoc/mp/server.adoc +++ b/docs/src/main/asciidoc/mp/server.adoc @@ -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):