Monolithic Deployment of Rust/Axum and Svelte/SvelteKit: An Elegant Solution?
2025-05-30
This article presents an unconventional approach to deploying SPAs in web development: embedding the built SPA directly into the backend binary. This simplifies deployment (single binary) and code (no CORS handling), but increases binary size, memory usage, and slightly reduces developer experience (no hot reloading). The author uses Rust/Axum and Svelte/SvelteKit to demonstrate, detailing a monorepo setup with the Moon build tool and using the rust-embed library to embed the frontend build artifacts. The result is a simple SPA fetching data from and navigating within the backend.
Development