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

Static serving of a webpage does not work correctly #149

Closed
m0mus opened this issue Nov 2, 2018 · 1 comment
Closed

Static serving of a webpage does not work correctly #149

m0mus opened this issue Nov 2, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@m0mus
Copy link
Contributor

m0mus commented Nov 2, 2018

When statically serving a webpage (with index.html + js and other resources), by using the following property:

server.static.classpath.context=/ui

and having something like this in the index.html

<script data-main='require.config' src='./libs/requirejs/require.js'></script>

The webpage fails to load when using http://localhost:7001/ui, because the relative URIs cannot be resolved correctly in this case. Normally, the webserver should redirect this URI to either http://localhost:7001/ui/ (note the slash at the end) or http://localhost:7001/ui/index.html

Reported by Martin Sladecek

@m0mus m0mus added the bug Something isn't working label Nov 2, 2018
@tomas-langer
Copy link
Member

Fixed by redirecting to /ui/ in case a default page exists and then serving the content.
Also added support for "server.base-path" in MP configuration.
If base path is configured, the root path will redirect to this path, e.g.
server.port: 8080
server.host: localhost
server.base-path: /ui/

When you request http://localhost:8080 you get redirected to http://localhost:8080/ui/

Fixed by #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants