añadido pagina de Posts, una store para la api, y header para mobile

This commit is contained in:
2025-11-14 15:15:26 -03:00
parent bc1f0acbaf
commit a2da01b29c
7 changed files with 138 additions and 15 deletions

16
src/routes/+page.ts Normal file
View File

@@ -0,0 +1,16 @@
import { apiBase } from '@/stores/url';
export const ssr = true;
export async function load({}) {
const { subscribe } = apiBase;
let baseUrl: string = '';
subscribe((value) => {
baseUrl = value;
})();
const req = await fetch(`${baseUrl}/Posts`);
if (req.ok) return { posts: req };
else return { posts: [] };
}