回答編集履歴
1
最近、typoひどい
answer
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
async await で書くならこうでしょうか。(動作未確認)
|
2
2
|
```js
|
3
3
|
function getLocation(city) {
|
4
|
-
|
4
|
+
return fetch(`https://cors-anywhere.herokuapp.com/www.metaweather.com/api/location/search/?query=${city}`)
|
5
5
|
.then(result => {
|
6
6
|
return result.json();
|
7
7
|
})
|
@@ -29,7 +29,7 @@
|
|
29
29
|
then でつなぐならこうでしょうか。(動作未確認)
|
30
30
|
```js
|
31
31
|
function getLocation(city) {
|
32
|
-
|
32
|
+
return fetch(`https://cors-anywhere.herokuapp.com/www.metaweather.com/api/location/search/?query=${city}`)
|
33
33
|
.then(result => {
|
34
34
|
return result.json();
|
35
35
|
})
|