Added API_PORT to client env

This commit is contained in:
ireic
2020-01-11 17:22:08 +01:00
parent f1f79dafff
commit 544b1f7e30
3 changed files with 8 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ import { objectToQueryString } from 'shared/utils/url';
import { getStoredAuthToken, removeStoredAuthToken } from 'shared/utils/authToken';
const defaults = {
baseURL: `http://localhost:${process.env.PORT || 3000}`,
baseURL: `http://localhost:${process.env.API_PORT || 3000}`,
headers: () => ({
'Content-Type': 'application/json',
Authorization: getStoredAuthToken() ? `Bearer ${getStoredAuthToken()}` : undefined,

View File

@@ -58,6 +58,12 @@ module.exports = {
template: path.join(__dirname, 'src/index.html'),
favicon: path.join(__dirname, 'src/favicon.png'),
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
API_PORT: JSON.stringify('3001'),
},
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
};