glove/tests/fixtures/remote-workerd/hello.mjs
trvon afecee2c90
feat(remote): add construction-only backend
Co-authored-by: trvon <git@trevon.dev>
Signed-off-by: trvon <git@trevon.dev>
2026-08-07 22:27:35 -04:00

20 lines
510 B
JavaScript

const handler = {
async fetch() {
return new Response("Hello, World!\n", {
status: 200,
headers: { "content-type": "text/plain; charset=utf-8" },
});
},
};
export default handler;
export const validation = {
async test() {
const response = await handler.fetch();
const body = await response.text();
if (response.status !== 200 || body !== "Hello, World!\n") {
throw new Error(`unexpected hello response: ${response.status} ${JSON.stringify(body)}`);
}
},
};