diff options
author | 2023-09-04 23:10:39 +0800 | |
---|---|---|
committer | 2023-09-04 23:10:39 +0800 | |
commit | d92ab065445b2ba904f01dae2c320d70af1e1f72 (patch) | |
tree | 38e17561c9905102d0c80c3908029754b1916e10 /examples/non-html-pages | |
parent | 77922ae5db5f40b8e228337b56af44d7c98bafbc (diff) | |
download | astro-d92ab065445b2ba904f01dae2c320d70af1e1f72.tar.gz astro-d92ab065445b2ba904f01dae2c320d70af1e1f72.tar.zst astro-d92ab065445b2ba904f01dae2c320d70af1e1f72.zip |
Update examples & uppercase endpoints & fix response (#8391)
Co-authored-by: liruifeng <liruifeng@troila.com>
Diffstat (limited to 'examples/non-html-pages')
-rw-r--r-- | examples/non-html-pages/src/pages/about.json.ts | 12 |
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/', + })); } |