summaryrefslogtreecommitdiff
path: root/examples/non-html-pages/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/non-html-pages/src')
-rw-r--r--examples/non-html-pages/src/pages/about.json.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/non-html-pages/src/pages/about.json.ts b/examples/non-html-pages/src/pages/about.json.ts
index af61847f3..7f98ba9fe 100644
--- a/examples/non-html-pages/src/pages/about.json.ts
+++ b/examples/non-html-pages/src/pages/about.json.ts
@@ -1,11 +1,9 @@
// Returns the file body for this non-HTML file.
// The content type is based off of the extension in the filename,
// in this case: about.json.
-export async function get() {
- return {
- body: JSON.stringify({
- name: 'Astro',
- url: 'https://astro.build/',
- }),
- };
+export async function GET() {
+ return new Response(JSON.stringify({
+ name: 'Astro',
+ url: 'https://astro.build/',
+ }));
}