export const routes = new Hono()
.get(
'/hello',
(c) => {
if (Math.random() > 0.5) {
return c.body(null, 204); // c.json(null, 204) will get the types to work but Response constructor: Invalid response status code 204 runtime error
}
return c.json({ hello: 'world' }, 200);
}
);
const response = await rpc.api.hello.$get();
const json = await response.json();
// ^^^^ unknown
export const routes = new Hono()
.get(
'/hello',
(c) => {
if (Math.random() > 0.5) {
return c.body(null, 204); // c.json(null, 204) will get the types to work but Response constructor: Invalid response status code 204 runtime error
}
return c.json({ hello: 'world' }, 200);
}
);
const response = await rpc.api.hello.$get();
const json = await response.json();
// ^^^^ unknown