Files
landing/src/main.ts
2026-02-28 02:34:41 +03:00

19 lines
464 B
TypeScript

import { mount } from "svelte";
import "./app.css";
import HomePage from "./routes/+page.svelte";
import HeartPage from "./routes/heart/+page.svelte";
const routes: Record<string, typeof HomePage> = {
"/": HomePage,
"/heart": HeartPage,
};
const normalizedPath = window.location.pathname.replace(/\/+$/, "") || "/";
const App = routes[normalizedPath] ?? HomePage;
const app = mount(App, {
target: document.getElementById("app")!,
});
export default app;