Added API_PORT to client env
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"start": "nodemon --exec ts-node --files src/index.ts",
|
||||
"start:test": "cross-env NODE_ENV='test' DB_DATABASE='jira_test' npm start",
|
||||
"start:production": "cross-env NODE_ENV=production pm2 start node -- -r ./tsconfig-paths.js build/index.js",
|
||||
"start:production": "pm2 start node -- -r ./tsconfig-paths.js build/index.js",
|
||||
"build": "cd src && tsc",
|
||||
"pre-commit": "lint-staged"
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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$/),
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user