astro/examples/non-html-pages/src/pages/index.astro

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
362 B
Text
Raw Normal View History

---
const url = `${Astro.request.canonicalURL.origin}/company.json`;
const response = await fetch(url);
const data = await response.json();
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Astro</title>
</head>
<body>
<h1>Astro</h1>
<div>{JSON.stringify(data)}</div>
</body>
</html>