0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-04-07 23:41:43 -05:00

Remove support for simple objects in endpoints (#9181)

* Deprecate simple object from endpoints

* Update changeset

* Add missing Response return

Co-authored-by: Happydev <81974850+MoustaphaDev@users.noreply.github.com>

* Update .changeset/clever-beds-notice.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Happydev <81974850+MoustaphaDev@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
This commit is contained in:
Bjorn Lu 2023-11-28 01:51:57 +08:00 committed by GitHub
parent 931cdb6243
commit 60752197b7

View file

@ -1,9 +1,7 @@
export async function GET() {
let number = Math.random();
return {
body: JSON.stringify({
number,
message: `Here's a random number: ${number}`,
}),
};
return Response.json({
number,
message: `Here's a random number: ${number}`,
});
}