fix node_env
This commit is contained in:
parent
bc78c82616
commit
b9b14fa785
|
@ -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 install -D --force
|
||||||
RUN cd /home/node/app/node_api/web && npm run build
|
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"]
|
||||||
|
|
|
@ -81,7 +81,7 @@ async function fetchTTSAudioURL(req, phrase, phraseId) {
|
||||||
await synthesizePollyVoice(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) {
|
async function handleApiRequest(req, res) {
|
||||||
|
|
Loading…
Reference in New Issue