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
The endpoint config option only has an impact if the server is started via server.start(). For integrations like Next.js etc. it is not relevant and can be omitted.
It might make sense to move the endpoint option to server.start({ endpoint: "/foo" }) instead.
Instead of endpoint, the key could also be named route.
This would be a breaking change
The text was updated successfully, but these errors were encountered:
What would you think about keeping the existing implementation but also adding the a configuration option through server.start() as well? Then, build in a deprecation warning and carry both options through another major version?
The start implementation would then need to take priority if both were configured, and maybe a warning urging people to switch? Documentation on the change and log outputs would both need to be explicit to catch as many users as possible before the deprecation.
Another thought I just had is one of semantics though. Right now, createServer makes sense in the context of what you are doing, because you are creating and configuring the HTTP server to run. Having the ability to start the server with a different config could be useful, though I can't think of any reason you would configure it once just to configure it again off the top of my head. (I'm sure there are many though).
So maybe adding a second entry point would work? Something like createHandler that would essentially create a route handler without the server options that aren't needed, because frameworks like Next.js and Sveltekit are handling ports and routing to begin with. Then it becomes non-breaking and would just need to be documented to educate users.
Does this make sense, and am I anywhere near the mark of what you were thinking?
The endpoint config option only has an impact if the server is started via
server.start()
. For integrations like Next.js etc. it is not relevant and can be omitted.It might make sense to move the
endpoint
option toserver.start({ endpoint: "/foo" })
instead.Instead of
endpoint
, the key could also be namedroute
.This would be a breaking change
The text was updated successfully, but these errors were encountered: