You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just been reading through some of the decisions made for Fresh 2.0. There's a lot of progress, so great work! I have one question regarding the use of the new define helpers. If a route only needs a POST handler, will we still need to define a GET handler? I did like just exporting a default page component for basic pages and then defining a POST handler. It seems (maybe I'm wrong) in the early alpha I need to define a default GET handler too (one that just returns the page) if I define a POST handler.
We should definitely add a default handler. Was an oversight on my part, there is no reason for it to not be there.
The text was updated successfully, but these errors were encountered:
Just confirming I understand the request here. Imagine I have a route like this:
import{define}from"../utils.ts";exportconsthandler=define.handlers({POST: (_ctx)=>{console.log("i've posted");returnnewResponse("POST");},});exportdefaultdefine.page(functionPostPage(){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?
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.
The text was updated successfully, but these errors were encountered: