alfred
1.1.3, released 2 years ago by an unverified publisher
A performant, Express.js-like web server and REST API framework for Dart.
What it does
Alfred is a web server and REST API framework inspired by Express.js. It features automatic type handling for responses, built-in body parsing, file uploads, routing with parameter validation, middleware support, and CORS handling.
AI-written summary of version 1.1.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to build a lightweight REST API or web server in Dart with familiar Express.js patterns.
- You need automatic response serialization for JSON, plain text, and binary/files.
Skip it when
- You are building a client-side Flutter application UI.
- You require full integration with pre-built ecosystem servers like Shelf if your architecture strictly depends on it.
Strengths
- Express.js-like routing and syntax that is easy to learn.
- Minimal dependencies and close adherence to Dart core libraries.
- Built-in type handlers that automatically resolve responses based on return types.
Weaknesses
- Less extensive ecosystem compared to larger Node.js frameworks.
- Not documented for advanced features beyond standard REST and routing use cases without custom type handlers.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
import 'package:alfred/alfred.dart';
void main() async {
final app = Alfred();
app.get('/example', (req, res) => 'Hello world');
await app.listen();
}Alternatives
Packages that do the same job and could replace alfred.
- flint_dart
Full‑stack Dart framework for building server, UI, and APIs in pure Dart
74Compare - finch
A lightweight Dart framework for building server‑side web apps, APIs, databases and WebSockets.
81Compare - vania
A fast backend framework for Dart with routing, ORM, migrations, and middleware.
71Compare - relic_core
Core framework for Relic web server
82Compare
Works with
Packages commonly used together with alfred: ones it builds on, ones built on it, and its own family.
- mimealfred depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- mime_typealfred depends on itLibrary to map file names or extensions to MIME types and vice versa
- queuealfred depends on itQueue up futures from multiple sources and await their return anywhere in your code.