use node_env

This commit is contained in:
srgooglo 2025-02-22 06:21:31 +01:00
parent 39165b3ca3
commit bc78c82616
2 changed files with 2 additions and 2 deletions

View File

@ -18,4 +18,4 @@ RUN cd /home/node/app/node_api/api && npm install -D --force
RUN cd /home/node/app/node_api/web && npm install -D --force
RUN cd /home/node/app/node_api/web && npm run build
CMD ["node", "/home/node/app/node_api/api/index.js"]
CMD ["NODE_ENV=production", "node", "/home/node/app/node_api/api/index.js"]

View File

@ -81,7 +81,7 @@ async function fetchTTSAudioURL(req, phrase, phraseId) {
await synthesizePollyVoice(phrase, phraseId)
}
return `${req.protocol}://${req.get("host")}${req.path}/audio/${phraseId}.mp3`
return `${NODE_ENV === "production" ? "https" : req.protocol}://${req.get("host")}${req.path}/audio/${phraseId}.mp3`
}
async function handleApiRequest(req, res) {