Vite (vanilla) SSR
This example demonstrates how to run Vite with server-side rendering (SSR).
Initialization
The project was instantiated via:
Code
The accompanying Dockerfile and Kraftfile are
necessary for deploying to Unikraft Cloud.
Deployment
To run this example, follow these steps:
-
Install the CLI. Use the unikraft CLI or the legacy kraft CLI. You need a BuildKit builder. The easiest way to get one is via Docker. Alternatively, you can also directly set up and use BuildKit, see the quick start.
-
Clone the
examplesrepository andcdinto theexamples/httpserver-node-vite-ssr-vanilla/directory:
Code
Make sure to log into Unikraft Cloud and pick a metro close to you.
This guide uses fra (Frankfurt, 🇩🇪):
When done, run:
The output shows the instance address and other details:
In this case, the instance name is httpserver-node-vite-ssr-vanilla-k8x2m and the address is https://warm-sky-qp3mn4rs.fra.unikraft.app.
They're different for each run.
After deploying, you can query the service using the provided URL.
You can list information about the instance by running:
When done, you can remove the instance:
Learn more
- NGINX's Documentation
- Vite's Documentation
- Unikraft Cloud's Documentation
- Building
Dockerfileimages withBuildkit - Vite (vanilla) node "dev" server on Unikraft Cloud
- Vite (vanilla) static build on Unikraft Cloud
Use the --help option for detailed information on using Unikraft Cloud:
Or visit the CLI Reference or the legacy CLI Reference.