Skip to content
fetchlet

Embed your web framework in Rust.

fetchlet runs the server side of SvelteKit, Astro, TanStack Start, React Router, Nuxt, and more inside a Rust process—on QuickJS, Boa, or V8. Ship a rich web UI in a single binary, with no Node.js runtime or reverse proxy.

Bundle your framework with a fetchlet adapter, then serve client assets, Rust routes, and SSR pages from one axum server.

import { sveltekit } from "@sveltejs/kit/vite";
import fetchletAdapter from "fetchlet/sveltekit";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [
    sveltekit({
      adapter: fetchletAdapter({ out: "build" }),
    }),
  ],
});
vite.config.ts
use axum::{Router, routing::get};
use fetchlet_http::Server;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let listener = tokio::net::TcpListener::bind("127.0.0.1:3000").await?;
    Server::new("build")
        .routes(|_| Router::new().route("/api/health", get(|| async { "ok" })))
        .serve(listener)
        .await?;
    Ok(())
}
server/main.rs

Keep the framework you already know.

All framework guides

JavaScript renders.
Rust owns the rest.

Route internal origins straight to your axum router with zero TCP overhead, inject upstream API tokens after authorization so JavaScript never sees them, and cap memory and execution time per request—all from one Rust configuration.

let router = OriginRouter::new()
    .internal("https://fetchlet.internal", router_transport(api))?
    .external("https://api.example.com", HttpClient::new())?
    .into_service()
    .credentials(|url, headers| {
        if url.host_str() == Some("api.example.com") {
            headers.insert("authorization", token.parse()?);
        }
        Ok(())
    });

Server::new("build")
    .host_services(move || HostServices::new().outbound(router.clone()))
    .limits(Limits {
        timeout: Some(Duration::from_secs(5)),
        heap_bytes: Some(64 * 1024 * 1024),
        ..Default::default()
    })

Three engines, one profile

Run the same WinterTC Web APIs and Node.js subset on QuickJS (fast startup), Boa (pure Rust), or V8 (JIT, native Intl, WebAssembly). Switch engines with one Cargo feature.

Deny-by-default permissions

JavaScript cannot touch the network, filesystem, or host env unless Rust grants it. Outbound HTTP, TCP, and WebSockets enforce exact allowlists and block private IPs to prevent SSRF.

Limits & process isolation

Bound timeouts, CPU busy time, engine heaps, body sizes, and subrequests in Rust. Enable the process feature to isolate each instance in a child process with OS memory limits.

From local HMR to a single binary.

  1. 01

    Develop with live reload

    Keep your Rust host running while Vite serves browser HMR and your Rust engine evaluates updated server modules on the fly.

    Development server
    fetchlet dev --vite "vite dev" -- cargo run --features vite-dev
  2. 02

    Build a portable artifact

    Bundles your server entry with only the polyfills your target engine lacks, plus Brotli-compressed static assets in assets.flpk.

    Building artifacts
    vite build
  3. 03

    Ship one executable

    Embed the server bundle and asset archive into your Rust binary—ready for CLIs, Tauri desktop apps, or self-hosted deployments.

    Embedding & distribution
    let artifact = fetchlet_http::include_artifact!("../build");

Start building with fetchlet.

Add an adapter to your web app, serve it from Rust, and ship one binary.

Type to search the documentation.