Monoserve Demo
When I go to school:
- There are so many good static hosting sites, but they don't allow for server logic.
- There are a few serverless sites, but they all either have bad latency or are blocked.
- There are a number of container/VM hosters, but they usually restrict you to one container.
When you have as many projects as me, none of these solutions work on their own. Monoserve lets you run all your backends on one efficient "monoserver" so you can host your frontend wherever you want. This version is built for Vite projects and Fly deployment, but you could fork it and make it work differently.
If you want to use Monoserve, continue to the README. The rest of this page just demonstrates it.
Echo
This is powered by echo.remote.ts
, which is literally just
import { fn } from "monoserve"; import { string } from "valibot"; export default fn(string(), (text) => text);
This format is heavily inspired by SvelteKit's Remote Functions, but it's a little different. It works in any Vite-based project, not just SvelteKit. It explicitly generates stubs for the client and bundles for the server. And of course, it uses one server.