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

4.x: Add documentation for server.base-path #9677

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 17 additions & 1 deletion docs/src/main/asciidoc/mp/server.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2022, 2024 Oracle and/or its affiliates.
Copyright (c) 2022, 2025 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down 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
Loading