Vite (vanilla)
This example demonstrates how to run a Vite project which
executes via the vite program on top of the node runtime.
[!NOTE] This is not the most efficient way to run a Vite project! See
httpserver-nginx-vite-vanillafor more details.
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-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-vanilla-w9f3p and the address is https://bold-rain-mv5tx8wy.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) static build on Unikraft Cloud
- Vite (vanilla) SSR mode on Unikraft Cloud
Use the --help option for detailed information on using Unikraft Cloud:
Or visit the CLI Reference or the legacy CLI Reference.