One of our main goals is to provide the best possible developer experience. We provides a fully-typed API. All plugins share a similar API, creating a consistent and predictable experience.
No need for an additional method, just return the value to send data back to the client.
Infers types to TypeScript automatically to create unified type system like statically typed language.
Generates OpenAPI 3.0 specs automatically to integrate with various tools across multiple languages.
Unified type system and outstanding developer experience.
// Whether it's a regular string, or complex JSON, just return the value
import { Application } from "@teakit/core";
const app = new Application()
.get("/", () => "Hello World")
.get("/json", () => ({
hello: "world",
}))
.listen(3000);
// Infers types to TypeScript automatically
import { Application, t } from "@teakit/core";
const app = new Application()
.post("/profile", ({ body }) => body, {
body: t.Object({
username: t.String(),
}),
})
.listen(3000);
// Can generate Swagger in one line with the docs plugin.
import { Application } from "@teakit/core";
import { pluginDocs } from "@teakit/plugin-docs";
import { feed, users } from "./controllers";
const app = new Application()
.use(pluginDocs())
.use(users)
.use(feed)
.get("/", () => "hi")
.listen(3000);
// Synchronize types across all applications.
import { Application, t } from "@teakit/core";
// server.ts
const app = new Application()
.patch("/user/age", ({ body }) => signIn(body), {
body: t.Object({
name: t.String(),
age: t.Number(),
}),
})
.listen(80);
export type App = typeof app;
// client.ts
import { edenTreaty } from "@teakit/eden";
import type { App } from "server";
const eden = edenTreaty<App>("http://localhost");
await eden.user.age.patch({
name: "saltyaom",
age: "21",
});