mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Adding serve.json so epub.html is not rewritten by serve. Buildling app during pi-gen/debian image builds.
This commit is contained in:
parent
d2ae135e5b
commit
104d2ec6a7
4 changed files with 17 additions and 3 deletions
13
app/serve.json
Normal file
13
app/serve.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"rewrites": [
|
||||
{
|
||||
"source": "/epub/epub.html",
|
||||
"destination": "/epub/epub.html"
|
||||
},
|
||||
{
|
||||
"source": "**",
|
||||
"destination": "/index.html"
|
||||
}
|
||||
],
|
||||
"cleanUrls": false
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue