Adding serve.json so epub.html is not rewritten by serve. Buildling app during pi-gen/debian image builds.

This commit is contained in:
Roland 2025-03-13 19:34:28 -06:00
parent d2ae135e5b
commit 104d2ec6a7
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
4 changed files with 17 additions and 3 deletions

13
app/serve.json Normal file
View file

@ -0,0 +1,13 @@
{
"rewrites": [
{
"source": "/epub/epub.html",
"destination": "/epub/epub.html"
},
{
"source": "**",
"destination": "/index.html"
}
],
"cleanUrls": false
}

View file

@ -18,6 +18,7 @@ cd /opt/wrolpi/app
npm --version
node --version
npm install
npm run build
# Install Node console commands.
npm i -g serve@12.0.1 single-file-cli@2.0.73 readability-extractor@0.0.6 carto@1.2.0

View file

@ -4,8 +4,8 @@ Wants=wrolpi-api.service
PartOf=wrolpi.target
[Service]
# Use development React app
ExecStart=/usr/bin/npm run start
# Use explicit `serve.json` so `epub.html` is not lost.
ExecStart=/usr/local/bin/serve build -l 3000 -c /opt/wrolpi/app/serve.json
Group=wrolpi
User=wrolpi
WorkingDirectory=/opt/wrolpi/app/

View file

@ -29,7 +29,7 @@ python3 -m venv /opt/wrolpi/venv
/opt/wrolpi/venv/bin/pip3 install -r /opt/wrolpi/requirements.txt
# Install webapp.
(cd /opt/wrolpi/app && npm install)
(cd /opt/wrolpi/app && npm install && npm run build)
chown -R wrolpi:wrolpi /opt/wrolpi