Static GitHub Issues

[943] Can I have Nuxt ignore a path?

prev: The following object does not support the "find" property or method
next: Nuxt Generate and AWS S3

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.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c807">#c807</a>)</em></sub></div>