#Confused on why upgrading from a route handler isn't allowed in Bun.

1 messages · Page 1 of 1 (latest)

shrewd coral
#

Why isn't upgrading from multiple routes just supported? This would be so clean and useful for me if it worked:

slender pollen
#

websocket can not be upgrade from a "POST" request ?

shrewd coral
#

Sorry

#

I talked about this in #general with one of the moderators here.

#

Basically, what I was doing was using a POST request with the websocket, which is invalid and not supported by the spec to be upgraded or support upgrading.

#

Another issue was that the type annotations for serve didn't support having routes and websocket in the same object passed in, which I was told to just use /* @ts-ignore */ for