-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made frontend and backend talk to eachother
- Loading branch information
Braga Lund
committed
Nov 28, 2021
1 parent
298762a
commit 6704b81
Showing
7 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Bragapi | ||
|
||
## TODO | ||
|
||
* [x] fix cors preflight request locally https://stackoverflow.com/questions/20792950/net-web-api-cors-preflight-request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<p>This is the weatherforecasts</p> | ||
<article v-for="forecast in forecasts" :key="forecast.id"> | ||
<p>{{ forecast.summary }}</p> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import WeatherForecastApi from "@/services/api/WeatherForecastApi"; | ||
export default { | ||
name: 'WeatherForecast', | ||
data() { | ||
return { | ||
loading: true, | ||
forecasts: [] | ||
} | ||
}, | ||
created() { | ||
WeatherForecastApi.getWeatherForcasts().then(forecasts => { | ||
this.forecasts = forecasts | ||
}).catch(error => | ||
console.log(error)) | ||
.finally(() => { | ||
this.loading = false | ||
} | ||
) | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
import axios from 'axios' | ||
|
||
axios.defaults.baseURL = 'https://localhost:7189' | ||
axios.defaults.headers.common['Access-Control-Allow-Origin'] = '*'; | ||
|
||
createApp(App).mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import axios from 'axios' | ||
|
||
export default { | ||
getWeatherForcasts(){ | ||
return axios.get('/weatherforecast',{ | ||
headers: { | ||
|
||
} | ||
}) | ||
.then(response => { | ||
return response.data | ||
}) | ||
}, | ||
} |