Quickstart
Create a project and run the first local Routa API.
Routa is a schema-first, OpenAPI-aware REST framework for new TypeScript APIs.
Route files define inputs, responses, middleware, metadata, and handler boundaries. From that contract, Routa can generate typed handlers, runtime validation, and OpenAPI. Routa can also start from an OpenAPI file and scaffold the first version of the source contract.
Create a new project.
pnpm create routa-ts@latestDefine route contracts in src/routes.
Use Routa to check, build, run, and keep OpenAPI aligned.
Routa v0 is intentionally narrow:
.yaml, .yml, and .json inputQuickstart
Create a project and run the first local Routa API.
Project anatomy
Learn the files Routa owns and the files your app owns.
Route contracts
Learn the source-of-truth model for Routa HTTP boundaries.
Scaffold from OpenAPI
Generate route files from an OpenAPI document.
Routa routes are filesystem-backed. Folders map to URL segments, and each route.ts file owns the methods for that path.
src/routes/users/route.tssrc/routes/users/$id/route.tsEach method is declared as a route contract:
export default defineRoute({ post: createRoute({ input: { body: CreateUserSchema, }, responses: { success: { status: 201, schema: UserSchema, }, }, run: async ({ input, ctx }) => { return users.createUser(input.body, ctx); }, }),});Handlers return named outcomes from the declared response map. Business logic stays in application-owned services, modules, use cases, or domain code. Routa owns the HTTP boundary: routing, validation, middleware context, typed responses, and OpenAPI.