quasar-app-extension-netlify
v1.1.1
Published
Deploy Quasar to netlify with SSR mode
Readme
Quasar App Extension netlify
Deploy Quasar SSR apps to Netlify — zero config required!
Demo
- GitHub repo: https://github.com/dongwa/quasar-netlify-test
- Live preview: https://quasar2-ssr.netlify.app/
Install
quasar ext add netlifyThis will:
- Install the extension via npm
- Create a
netlify.tomlwith the correct build settings (if one doesn't exist)
Usage
Works out of the box — no changes to your project needed. Just build and deploy:
quasar build -m ssrThe extension automatically:
- Redirects the build output to
.netlify/v1/functions/index - Creates a Netlify Function that wraps your Express SSR app
- Configures
preferStatic: trueso static assets are served directly by Netlify's CDN
Advanced: Custom handler export
By default, the extension uses the Express app exported by Quasar's SSR build. If you prefer to export a custom handler (as recommended in Quasar's serverless docs), you can modify src-ssr/server.js:
export const listen = defineSsrListen(({ app, devHttpsApp, port }) => {
const server = devHttpsApp || app;
if (process.env.DEV) {
return server.listen(port, () => {
console.log('Server listening at port ' + port);
});
} else {
return { handler: server };
}
});When handler is exported as a function, it takes priority over app. This gives you full control over the request handler if needed.
Uninstall
quasar ext remove netlifyHow it works
Uses Netlify Functions v2 to run your Quasar SSR app as a serverless function. Incoming requests are converted to Node.js IncomingMessage/ServerResponse objects and passed to your Express app.
License
MIT (c) donglin
