現在情報取得APIをGaSに移行
This commit is contained in:
parent
94558b784a
commit
d5fab2f49b
3
App.js
3
App.js
@ -69,9 +69,10 @@ export default function App() {
|
|||||||
|
|
||||||
const [currentTrain, setCurrentTrain] = useState([]); //現在在線中の全列車 { num: 列車番号, delay: 遅延時分(状態), Pos: 位置情報 }
|
const [currentTrain, setCurrentTrain] = useState([]); //現在在線中の全列車 { num: 列車番号, delay: 遅延時分(状態), Pos: 位置情報 }
|
||||||
const [currentTrainLoading, setCurrentTrainLoading] = useState("loading"); // success, error, loading
|
const [currentTrainLoading, setCurrentTrainLoading] = useState("loading"); // success, error, loading
|
||||||
|
|
||||||
const getCurrentTrain = () =>
|
const getCurrentTrain = () =>
|
||||||
fetch(
|
fetch(
|
||||||
"https://train.jr-shikoku.co.jp/g?arg1=train&arg2=train",
|
"https://script.google.com/macros/s/AKfycby9Y2-Bm75J_WkbZimi7iS8v5r9wMa9wtzpdwES9sOGF4i6HIYEJOM60W6gM1gXzt1o/exec",
|
||||||
HeaderConfig
|
HeaderConfig
|
||||||
)
|
)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
|
Loading…
Reference in New Issue
Block a user