mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-25 01:13:40 +01:00
Add SERVER_URL constant based on environment
This commit is contained in:
parent
5755f3a699
commit
2ccd656386
@ -3,8 +3,8 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve --mode development",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build --mode production",
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -11,6 +11,7 @@ import Social from './components/Social.vue'
|
|||||||
import Settings from './components/Settings.vue'
|
import Settings from './components/Settings.vue'
|
||||||
import Services from './components/Services.vue';
|
import Services from './components/Services.vue';
|
||||||
import Tooltip from './components/Tooltip.vue';
|
import Tooltip from './components/Tooltip.vue';
|
||||||
|
import {SERVER_URL} from "./main.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
@ -23,7 +24,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
fetchStatuses() {
|
fetchStatuses() {
|
||||||
console.log("[App][fetchStatuses] Fetching statuses");
|
console.log("[App][fetchStatuses] Fetching statuses");
|
||||||
fetch("http://localhost:8080/api/v1/statuses")
|
fetch(`${SERVER_URL}/api/v1/statuses`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (JSON.stringify(this.serviceStatuses) !== JSON.stringify(data)) {
|
if (JSON.stringify(this.serviceStatuses) !== JSON.stringify(data)) {
|
||||||
|
@ -2,4 +2,6 @@ import { createApp } from 'vue'
|
|||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import './index.css'
|
import './index.css'
|
||||||
|
|
||||||
|
export const SERVER_URL = process.env.NODE_ENV === 'production' ? '.' : 'http://localhost:8080'
|
||||||
|
|
||||||
createApp(App).mount('#app')
|
createApp(App).mount('#app')
|
||||||
|
Loading…
Reference in New Issue
Block a user