mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 23:43:27 +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",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"serve": "vue-cli-service serve --mode development",
|
||||
"build": "vue-cli-service build --mode production",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -11,6 +11,7 @@ import Social from './components/Social.vue'
|
||||
import Settings from './components/Settings.vue'
|
||||
import Services from './components/Services.vue';
|
||||
import Tooltip from './components/Tooltip.vue';
|
||||
import {SERVER_URL} from "./main.js";
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
@ -23,7 +24,7 @@ export default {
|
||||
methods: {
|
||||
fetchStatuses() {
|
||||
console.log("[App][fetchStatuses] Fetching statuses");
|
||||
fetch("http://localhost:8080/api/v1/statuses")
|
||||
fetch(`${SERVER_URL}/api/v1/statuses`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (JSON.stringify(this.serviceStatuses) !== JSON.stringify(data)) {
|
||||
|
@ -2,4 +2,6 @@ import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import './index.css'
|
||||
|
||||
export const SERVER_URL = process.env.NODE_ENV === 'production' ? '.' : 'http://localhost:8080'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
|
Loading…
Reference in New Issue
Block a user