183
184 try {
185 const response = await fetch("/", {
186 method: "POST",
187 body: JSON.stringify({
8
9 useEffect(() => {
10 async function fetchStatus() {
11 try {
12 const response = await fetch('https://api.spacetraders.io/v2/');
13 if (!response.ok) throw new Error('Failed to fetch status');
14 const data = await response.json();
15 setStatus(data);
18 }
19 }
20 fetchStatus();
21 }, []);
22
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
14 start = performance.now();
15 try {
16 const res = await fetch(url);
17 end = performance.now();
18 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);
10
11 useEffect(() => {
12 async function fetchWeather() {
13 try {
14 setLoading(true);
15 const response = await fetch(
16 `https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}¤t_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`
17 );
20 setLoading(false);
21 } catch (err) {
22 setError("Failed to fetch weather data");
23 setLoading(false);
24 }
25 }
26
27 fetchWeather();
28 }, [location]);
29
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
69
70 try {
71 const response = await fetch("/transcribe", {
72 method: "POST",
73 body: formData,
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({