astro/examples/non-html-pages/src/pages/index.astro
Juan Martín Seery dc6e89f0a3
chore: updated examples to v0.26.0 (#2977)
* New script behavior

* Astro.request

* Reverted `deno` to `node`

* Updated subpath
2022-04-03 14:02:57 -05:00

18 lines
545 B
Text

<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Astro</title>
</head>
<body>
<h1 id="result">Loading...</h1>
<script>
// Non-HTML files will be included in your final build, so you
// can fetch them directly in the browser.
const response = await fetch(`/about.json`);
const data = await response.json();
document.getElementById('result').innerHTML = `Load complete!<br/>Built with: <a href="${data.url}">${data.name}!</a>`;
</script>
</body>
</html>