Servers
You can embed Vike into any server, and use any server utilitiy.
Alternatively, instead of using a server, you can pre-render your pages and deploy to a static host.
Just a middleware
From the perspective of a server, Vike is just a middleware:
You can embed renderPage()
into any server.
Alternatively, instead of using renderPage()
, you can pre-render your pages and remove the need for a production server (and deploy to a static host instead).
You can use:
- Any server framework (Express, Fastify, Hono, Nitro, HatTip, Koa, Hapi, ...)
- Any authentication strategy/tool (email/password, OAuth, Auth.js, Passport.js, Grant, Keycloak, Auth0, ...).
- Any serverless/edge environment (Cloudflare Workers, Vercel, Firebase, AWS Lambda, Google Cloud Functions, Deno Deploy, ...)
- Any virtual private server (AWS EC2, Google Cloud, ...)
- Any static host (Cloudflare Pages, GitHub Pages, Netlify, ...)
- Any server utility (Docker, Nginx, PM2, ...)
Examples:
Non-JavaScript Backend
You can use Vike with a non-JavaScript backend using following setup:
- Your non-JavaScript backend implements the business logic of data while exposing a REST/GraphQL API.
- Your Vike app uses that REST/GraphQL API to render your pages to HTML while hydrating them to a rich interactive user interface.
If you want SSR, then you need to deploy two server runtimes: your non-JavaScript runtime as well as a JavaScript server runtime (Node.js/Deno/Bun).
Alternatively, instead of using a server JavaScript runtime, you can pre-render your pages while disabling SSR. In other words: you generate empty HTML shells that you statically deploy (using a static host or your own static assets deployment).
The HTML must be generated by Vike because the UI is completely owned by React/Vue/Solid. You cannot generate the HTML using your non-JavaScript backend: React/Vue/Solid would complain that it doesn't match and completely erase your HTML.
That way, you can use Vike with any backend:
- Java (Spring, Grails, ...)
- PHP (Laravel, Symfony, CakePHP, ...)
- Ruby on Rails
- Python (Django, Flask, FastAPI, ...)
- Elixir (Phoenix, ...)
- Go (Gin, Echo, Fiber, ...)
- Rust (Actix Web, Rocket, ...)
- Backend-as-a-Service (Firbase, ..)
- ...
Example:
HTTPS
In production, Vike is only a server middleware; there is nothing to take into consideration.
If you want to use HTTPS in development as well, then make sure to pass the HTTPS certificates to Vite's dev server.