import { createSignal } from "solid-js"; import { Course } from "../types/Course"; export const [allCourses, setAllCourses] = createSignal>([]); (() => { // Get all courses from the API fetch(`${import.meta.env.VITE_BACKEND_URL}/api/course`) .then((res) => res.json()) .then((data) => setAllCourses(data)); })();