diff --git a/src/pages/homepage.astro b/src/pages/homepage.astro new file mode 100644 index 0000000..5542298 --- /dev/null +++ b/src/pages/homepage.astro @@ -0,0 +1,42 @@ +--- +import Layout from '../layouts/Layout.astro'; + +const apiKey = 'b5760280b2464ac990288c03c4b8b1bc'; + +const handleError = (err: any) => { + console.log(err); + // The requested Builder content could not be found. + if (err.response.status === 404) { + return { data: null }; + } + throw err; +}; + +const encodedUrl = encodeURIComponent('/homepage'); + +const { data: pageData } = await fetch( + `https://cdn.builder.io/api/v1/html/page?apiKey=${apiKey}&url=${encodedUrl}` +) + .then((res) => res.json()) + .catch(handleError); +--- + + +

home page

+ +
+
+ +