11192 shaares
389 private links
389 private links
How to serve typescript file?
Using a proxy mounted on a route that did a passthrough to a vite front-end app And in production we switched out that proxy for a StaticDir.
I use vite. In development vite dev server proxies requests to (axum) backend, for production vite compiles the frontend bits into a bundle that can be served by axum in a specific route. I'm sure ServeDir would work with this setup, but I actually include the bundle in my executable with a small macro which makes deployments stupid simple.