Svarta
Svarta is a TypeScript-native, ESM-native platform-agnostic REST API framework.
By abstracting the underlying platform, it allows deployment to different platforms without changing your code.
You also get:
- file-based routing, similar to Astro, Next.js or SvelteKit
- type-safe middlewares
- input validation (with Zod)
- dependency bundling (treeshaking etc.)
- CLI to scaffold projects
- development server with HMR
- MIT license
It aims to provide a more robust developer experience than established packages like Express or Koa, while being lightweight and hassle-free when using TypeScript.
Svarta will scaffold your application from the ground up, removing the overhead of installing and setting up development dependencies, toolchains and build scripts. Say goodbye to decision fatigue and setting up 15 packages to get your Express project started!
Quick start
pnpm create svarta-app
pnpm create svarta-app
yarn create svarta-app
yarn create svarta-app
npm create svarta-app
npm create svarta-app
Then, start the development server:
pnpm dev
pnpm dev
yarn dev
yarn dev
npm run dev
npm run dev
The default project contains an index.html
file that is served as /
and an API route that returns a text, which will be inserted into the HTML page.
Check out Concepts to learn how to create routes.