File routing first
Start with folders and route files. Spry scans your tree and generates a concrete app definition you can inspect.
Next-generation Dart server framework. Build modern servers and deploy them to the runtime you prefer.
spry serveStay inside a normal Dart project, add a routes/ tree, and let Spry build and serve the generated app during development.
Use defineSpryConfig(...) to control host, port, output, reload behavior, and build target without changing your route code.
Spry does not hide its runtime entry. The scanner emits a real app and a real main file so the build stays understandable.
Spry v7 is organized around a runtime pipeline, not around imperative route registration. The folder tree is the contract. Route files define handlers. _middleware.dart and _error.dart shape 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.request.url.path,
});
}import 'package:spry/config.dart';
void main() {
defineSpryConfig(
host: '127.0.0.1',
port: 4000,
target: BuildTarget.dart,
);
}Spry keeps the authoring model simple: folders define routes, scoped files shape behavior, and runtime choice stays in config. The result is less ceremony than a traditional server stack without turning the framework into a black box.
routes/ scannerScoped middlewareScoped error boundariesPublic asset servingLifecycle hooksResponse values directly.Next instead of global mutation.Event object.Spry(...) app with route and middleware maps.main.dart entrypoint.That is the design center for the v7 docs. Minimal files, explicit output, and deployment targets that do not force a rewrite.