I'm trying to use GraphQL's subscriptions-transport-ws with Nuxt. It appears to return a plain HTTP.Server
, not Connect middleware, and it's mounted by setting the path attribute when constructing. So IOW I can't use app.use("/subscriptions", ...)
to mount the server.
I think I'm creating it correctly, but I think nuxt.render
is intercepting all routes, and since I can't use this server as middleware, I can't insert it into the chain before Nuxt grabs everything.
Is there any way to tell nuxt.render
to pass through routes at a certain path?
One way I thought to do this was to set up middleware to intercept paths starting with /subscriptions. I then thought that perhaps I could tell Nuxt to stop processing the request altogether and not even return its error page, but I couldn't see a way to do this. Maybe the Connect middleware's next()
function can be attached to the context on the server? I matched the path, but couldn't halt processing by Nuxt.