initial backend

This commit is contained in:
2025-09-05 13:40:15 +02:00
parent ab588833b6
commit 48c1811c30
16 changed files with 210 additions and 7 deletions

View File

@@ -1,6 +1,20 @@
import type { Component } from "solid-js";
import { createSignal, For, onMount } from "solid-js";
interface Weather {
date: string;
temperatureC: number;
temperatureF: number;
summary: string;
}
const App: Component = () => {
const [weather, setWeather] = createSignal<Weather[]>([]);
onMount(() => {
fetch("/api/weatherforecast")
.then((r) => r.json())
.then(setWeather);
});
return (
<div>
<header>
@@ -15,6 +29,15 @@ const App: Component = () => {
Learn Solid
</a>
</header>
<For each={weather()}>
{(item) => (
<li>
{item.date} - {item.temperatureC}°C / {item.temperatureF}°F -{" "}
{item.summary}
</li>
)}
</For>
</div>
);
};