quasar
quasar copied to clipboard
Custom SSR server for `@quasar/app`/`@quasar/app-webpack`
Quasar CLI with Vite already supports this https://quasar.dev/quasar-cli-vite/developing-ssr/ssr-webserver#replacing-express-js
Is your feature request related to a problem? Please describe. Not all project using express as backend.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] That's not easy when I need to implement ssr but without express
Describe the solution you'd like Would be great if there is an API or config to replace express easily, AFAIK, there are lot of express alternatives that have same API, restana, fastify + middie, 0http, etc...
Describe alternatives you've considered But if we have an adapter or clear interface for the server, it would great!
It would be nice to have that option. For me I would love to be able to use fastify easily when running quasar dev
There's a PR above that looks promising, but as I commented there, the new Quasar-Vite configuration might help facilitate shimming the alternative backend of choice.
@Blfrg when using Quasar CLI with Vite, it's really easy to replace Express with another package that has compatible API(connect, fastify + middie, etc.), both on development and production: https://quasar.dev/quasar-cli-vite/developing-ssr/ssr-webserver#replacing-express-js
As you seem to be interested in Fastify, let me also share this bit: https://github.com/fastify/fastify/blob/v4.2.0/docs/Reference/Middleware.md#middleware
Starting with Fastify v3.0.0, middleware is not supported out of the box and requires an external plugin such as
@fastify/express
or@fastify/middie
.
@quasar/app-webpack
v3.2+ supports this through production export script, but only on production build:
https://quasar.dev/quasar-cli-webpack/developing-ssr/ssr-production-export
@quasar/app-webpack
v4 will have the same dev/prod support as app-vite. It's not been released yet, but it's implemented. So, I am closing the issue. Thanks, everyone!