Skip to content

Commit 0e2429c

Browse files
committed
⚙️ Fixing app prod: removing localhost calls
1 parent 2bd7cda commit 0e2429c

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

stubs/dashboard/nuxt.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default {
4848
// Axios module configuration: https://go.nuxtjs.dev/config-axios
4949
axios: {
5050
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
51-
baseURL: '/'
51+
baseURL: (process.env.NODE_ENV === 'production' ? '/' : 'http://localhost:8081/')
5252
},
5353

5454
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify

stubs/dashboard/pages/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default {
134134
},
135135
methods: {
136136
async longPolling() {
137-
this.$axios.$get('http://localhost:8081/poll', {timeout: 10000}).then((response) => {
137+
this.$axios.$get('/poll', {timeout: 10000}).then((response) => {
138138
try {
139139
response.body = JSON.parse(response.body);
140140
} catch (e) {
@@ -159,7 +159,7 @@ export default {
159159
const time = this.time();
160160
// Could be using Swagger generated client, but it would validate fields!
161161
this.$axios.$post(
162-
'http://localhost:8081/forward',
162+
'/forward',
163163
{
164164
endpoint: this.form.core.urlSiSamu + endpoint,
165165
data: this.form.clickToCall

stubs/lrm/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require('path');
33
const config = {
44
ROOT_DIR: __dirname,
55
URL_PORT: process.env.PORT || 8081,
6-
URL_PATH: 'http://localhost',
6+
URL_PATH: process.env.URL || 'http://localhost',
77
BASE_VERSION: '/lrm/api',
88
CONTROLLER_DIRECTORY: path.join(__dirname, 'controllers'),
99
PROJECT_DIR: __dirname,

0 commit comments

Comments
 (0)