fix node_env

This commit is contained in:
srgooglo 2025-02-22 06:24:04 +01:00
parent bc78c82616
commit b9b14fa785
2 changed files with 4 additions and 2 deletions

View File

@ -18,4 +18,6 @@ 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_ENV=production", "node", "/home/node/app/node_api/api/index.js"]
# set to production
ENV NODE_ENV=production
CMD ["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 `${NODE_ENV === "production" ? "https" : req.protocol}://${req.get("host")}${req.path}/audio/${phraseId}.mp3`
return `${process.env.NODE_ENV === "production" ? "https" : req.protocol}://${req.get("host")}${req.path}/audio/${phraseId}.mp3`
}
async function handleApiRequest(req, res) {