Use env variable for backend location
This commit is contained in:
parent
d91702b213
commit
60461d329c
1
front/bahnui-front/.env
Normal file
1
front/bahnui-front/.env
Normal file
@ -0,0 +1 @@
|
||||
VUE_APP_BASE_URL=http://127.0.0.1:3000
|
||||
@ -23,6 +23,10 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
|
||||
const client = axios.create({
|
||||
baseURL: process.env.VUE_APP_BASE_URL
|
||||
});
|
||||
const timecolors = [
|
||||
{r:147, g:147, b:147, h:0},
|
||||
{r:156, g:151, b:146, h:1},
|
||||
@ -62,14 +66,14 @@
|
||||
},
|
||||
methods: {
|
||||
searchStationFrom() {
|
||||
axios.get("http://localhost:3000/searchStation", {params: {text: this.from.name}}).then(res => this.from = {name: res.data.name, id: res.data.id});
|
||||
client.get("/searchStation", {params: {text: this.from.name}}).then(res => this.from = {name: res.data.name, id: res.data.id});
|
||||
},
|
||||
searchStationTo() {
|
||||
axios.get("http://localhost:3000/searchStation", {params: {text: this.to.name}}).then(res => this.to = {name: res.data.name, id: res.data.id});
|
||||
axios.get("/searchStation", {params: {text: this.to.name}}).then(res => this.to = {name: res.data.name, id: res.data.id});
|
||||
},
|
||||
searchConnection() {
|
||||
if (this.from.id && this.to.id){
|
||||
axios.get("http://localhost:3000/searchConnection", {params: {from: this.from.id, to:this.to.id}}).then(res => {this.connections = res.data;console.log(this.connections)});
|
||||
axios.get("/searchConnection", {params: {from: this.from.id, to:this.to.id}}).then(res => {this.connections = res.data;console.log(this.connections)});
|
||||
}
|
||||
},
|
||||
toDate(string){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user