Closed marvinhagemeister closed 1 week ago
Just confirming I understand the request here. Imagine I have a route like this:
import { define } from "../utils.ts";
export const handler = define.handlers({
POST: (_ctx) => {
console.log("i've posted");
return new Response("POST");
},
});
export default define.page(function PostPage() {
return <b>"This is a basic page."</b>;
});
What we want is for visiting http://localhost:8000/post
with the browser to return This is a basic page.
instead of Method Not Allowed
, right?
Yup, that should be the outcome. It should also work when no define.*
handler is used.
From discord: https://discord.com/channels/684898665143206084/991511118524715139/1254411831041196133
We should definitely add a default handler. Was an oversight on my part, there is no reason for it to not be there.