182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
187 try {
188 // Get coordinates for the city using geocoding
189 const geoResponse = await fetch(\`https://geocoding-api.open-meteo.com/v1/search?name=\${cityInput.value}&count=1&language=en&format=json\`);
190 const geoData = await geoResponse.json();
191
198
199 // Get weather data
200 const weatherResponse = await fetch(\`https://api.open-meteo.com/v1/forecast?latitude=\${latitude}&longitude=\${longitude}¤t_weather=true\`);
201 const weatherData = await weatherResponse.json();
202
212 \`;
213 } catch (error) {
214 weatherInfo.innerHTML = '<p class="text-red-500">Error fetching weather data</p>';
215 console.error(error);
216 }
36
37 const { Chess } = await import("https://esm.sh/chess.js@1.0.0-beta.8")
38 const position = (await fetch(`/game/${game_id}`).then(r => r.json())).fen
39 const thinking = document.querySelector("#thinking")
40 thinking.className = "transition-opacity opacity-0"
69 thinking.className = "transition-opacity opacity-100"
70
71 const response = fetch(`/game/${game_id}`, {
72 method: "POST",
73 body: JSON.stringify({ san: move.san }),
278})
279
280export default app.fetch
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({
33
34 // Post the message so we can deal with large text data.
35 await fetch(`/post-message?threadId=${input.getAttribute("data-thread-id")}`, {
36 method: "post",
37 body: msgDiv.textContent,
147 return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
148});
149export default app.fetch;
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({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({