File routing without framework magic
Start with folders and route files. Spry scans your tree, builds a concrete app definition, and keeps the runtime output inspectable.
File-routing Dart server framework with inspectable generated output, OpenAPI generation, and first-party typed clients.
Model routes, scoped middleware, and scoped errors with normal files instead of central route registries and framework ceremony.
Use defineSpryConfig(...) to choose the runtime target and build output without rewriting handlers for each platform.
Spry emits a real app and real runtime entry files so the build pipeline stays understandable during debugging, review, and deployment.
Spry is organized around a runtime pipeline, not around imperative route registration. The folder tree is the contract. Route files define handlers. defineHandler(...) keeps one-off behavior local to one route. _middleware.dart and _error.dart shape broader behavior by scope. spry.config.dart decides how the generated output should run.
.
├─ routes/
│ ├─ index.dart
│ ├─ about.get.dart
│ ├─ users/[id].dart
│ ├─ [...slug].dart
│ ├─ _middleware.dart
│ └─ _error.dart
├─ middleware/
│ └─ 01_logger.dart
├─ public/
│ └─ hello.txt
├─ hooks.dart
└─ spry.config.dartimport 'package:spry/spry.dart';
Response handler(Event event) {
return Response.json({
'message': 'hello from spry',
'runtime': event.context.runtime.name,
'path': event.url.path,
});
}import 'package:spry/config.dart';
void main() {
defineSpryConfig(
host: '127.0.0.1',
port: 4000,
target: BuildTarget.vm,
);
}Spry keeps the authoring model small: folders define routes, scoped files shape behavior, and runtime choice stays in config. The result is less ceremony than a traditional server stack without hiding how the app runs.
routes/ scannerScoped middlewareScoped error boundariesPublic asset servingLifecycle hooksResponse values directly.defineHandler(...) can wrap one route without introducing more files.Next instead of global mutation.Event object.Spry(...) app with route and middleware maps.main.dart entrypoint.Start with the quick start if you want to run a real project today, or jump to deploy docs if you are evaluating runtime targets first.