FEATURE: Data fetching VUE

This commit is contained in:
nikurasu 2023-11-26 21:47:43 +01:00
parent 35aeb1a7ef
commit e9b9af9fda
Signed by: Nikurasu
GPG key ID: 9E7F14C03EF1F271
2 changed files with 13 additions and 0 deletions

1
.env.development Normal file
View file

@ -0,0 +1 @@
VITE_BACKEND_URI=http://127.0.0.1:3000

View file

@ -7,6 +7,14 @@ let data = [
}
]
function fetchEvents() {
console.log(import.meta.env.VITE_BACKEND_URI)
fetch(`${import.meta.env.VITE_BACKEND_URI}/api/v1/public/event`)
.then((response) => {
console.log(response.json())
})
}
function test() {
this.data = 'outside'
}
@ -18,6 +26,10 @@ export default {
}
},
created() {
fetchEvents()
},
methods: {
changeText() {
this.data = 'another Test'