About mion
Full Stack APIs at the speed of light 🚀
WTF are Full Stack APIs?
Is the concept of fully integrate your API functions into your frontend application as if they were local functions.
All the complexity of http requests, methods, validation, serialization, etc... is abstracted away and you can just call your APIs as if they were local functions.
With mion, you can quickly build APIs that are type-safe, with automatic validation and serialization out of the box.
Quick Sample
import {initMionRouter, route, Routes} from '@mionjs/router';
import {startNodeServer} from '@mionjs/platform-node';
const routes = {
// fully validated params
sayHello: route((ctx, name: string): string => {
return `Hello ${name}!`;
}),
} satisfies Routes;
export const myApi = await initMionRouter(routes);
startNodeServer({port: 3000});
export type MyApi = typeof myApi;
import {initClient} from '@mionjs/client';
import type {MyApi} from './about-server.ts';
const {routes} = initClient<MyApi>({
baseURL: 'http://localhost:3000',
});
// Call server method as if it were a local function
const [hello] = await routes.sayHello('World').call();
console.log(hello); // hello world
Why Another Framework?
- There are not many frameworks that offer Full Stack APIs will all the features from mion and that take full advantage Typescript type system.
- Serverless applications have different requirements compared to conventional servers.
- mion takes advantage of a new generation of tools that bring types to runtime allowing automatic validation/serialization out of the box and a whole new set of possibilities.
- Generic HTTP frameworks have a lot of baggage that is not required for modern APIs.
Url or path
params, multiplemime-types, file uploads,multipart/form-dataand many other features that generic HTTP frameworks must support just make them more complicated and slow.
mion addresses these challenges by offering a lightweight and opinionated framework focused on simplicity and developer experience.
RunTypes
Automatic Serialization & Validation
RPC "Like"
mion is designed with a Remote Method Call (RPC) style where functions are the primary interface and there are no abstractions over the API data.
We use the term RPC "Like" to highlight that mion does not use an RPC or custom protocol. mion operates over HTTP yet it uses an RPC style routing.
Routing
Fast
Benchmarks
Check out the Benchmarks page for more info!