libelektra: website-frontend: all links do not work
Steps to Reproduce the Problem
~e/scripts/dev/configure-debian -DCMAKE_INSTALL_PREFIX=/srv -DTOOLS="ALL;website frontend" ~e
make -j 5 install
/srv/lib/elektra/tool_exec/mount-website-frontend-config
/srv/lib/elektra/tool_exec/run-website-frontend
#> Running "connect:server" (connect) task
#> Waiting forever...
#> Started connect web server on http://localhost:9000
Expected Result
That I can visit http://localhost:9000 and see something like https://www.libelektra.org
Actual Result
For every <page>, I get an error Cannot GET /<page>, the html source for root is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /</pre>
</body>
</html>
System Information
- Elektra Version: master
- npm --version: 5.8.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (16 by maintainers)
Yes, I think so. The
content_rootdefines the directory where dynamic contents are stored, which is/srv/share/elektra/tool_data/website/public/websitein your case. Since the script which uses this path is executed in thepublic/directory, it needs to prefix lookups with thewebsite/sub path.The
content_rootis configurable, but it makes no sense to do so I think. Or maybe it would require a full reinstallation of Elektra, not sure. It has been a long time. 👍Yes, this one here: https://github.com/ElektraInitiative/libelektra/blob/399856a673b25858e02b117f5787fb902e6485ad/src/tools/website-frontend/CMakeLists.txt#L18
But be careful, the variable is used in other files of the frontend as well.
I’ve installed it in a different path (using Debian Buster in WSL 2), but when I use the built-in PHP webserver to test it, it works perfectly fine for me.
Opening
http://localhost:9000in the browser yields the expected home page with working internal and external links. Enteringhttp://localhost:9000/something/not/existingwill redirect me to the/error/404page of the SPA and enteringhttp://localhost:9000/news/0.8.17-releaseyields a 404 error of the webserver, but that must have to do with the routing I guess (as explained earlier).