Fix api url in prod bug

This commit is contained in:
pikiou 2021-11-22 10:17:00 +01:00
parent 003ea65979
commit 02be480cca
2 changed files with 5 additions and 6 deletions

View File

@ -41,7 +41,9 @@
"scripts": { "scripts": {
"dev": "yarn dev:build && nodemon ./public/server", "dev": "yarn dev:build && nodemon ./public/server",
"dev:build": "cross-env NODE_ENV=development webpack --config ./webpack/server.config.ts", "dev:build": "cross-env NODE_ENV=development webpack --config ./webpack/server.config.ts",
"local-start": "cross-env INTRANET_HOST=localhost node ./public/server",
"start": "node ./public/server", "start": "node ./public/server",
"local-build": "cross-env INTRANET_HOST=localhost run-s build:*",
"build": "run-s build:*", "build": "run-s build:*",
"build:server": "cross-env NODE_ENV=production webpack --config ./webpack/server.config.ts", "build:server": "cross-env NODE_ENV=production webpack --config ./webpack/server.config.ts",
"build:client": "cross-env NODE_ENV=production webpack --config ./webpack/client.config.ts", "build:client": "cross-env NODE_ENV=production webpack --config ./webpack/client.config.ts",

View File

@ -1,11 +1,8 @@
const PORT = 4000 const PORT = 4000
const HOST_LOCALLY = true const HOST = process.env.INTRANET_HOST || "fo.parisestludique.fr"
export default { export default {
PORT, PORT,
HOST: HOST_LOCALLY ? "localhost" : "fo.parisestludique.fr", HOST: "0.0.0.0",
API_URL: API_URL: `http://${HOST}:${PORT}`,
__SERVER__ || HOST_LOCALLY
? `http://localhost:${PORT}`
: `http://fo.parisestludique.fr:${PORT}`,
} }