belatuk_http_server
5.0.0, released 4 weeks ago by dukefirehawk.com
Utility classes that simplify building Dart server‑side HTTP services with HttpServer.
What it does
Provides high‑level helpers such as body parsing, virtual directory serving, and request handling for Dart command‑line or server applications. It enforces RFC‑compliant JSON and form‑urlencoded handling and offers safe redirects and error handling.
AI-written summary of version 5.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to serve static files or APIs from a Dart server without writing low‑level HttpServer boilerplate
- You require strict RFC‑compliant request/response parsing for JSON and form data
Skip it when
- Your app runs on Flutter mobile/web where dart:io is unavailable
- You need client‑side HTTP calls rather than server handling
Strengths
- Strict RFC‑compliant parsing reduces bugs
- Built‑in virtual directory with safe redirects
- Works with pure Dart server code
Weaknesses
- Only works in server/CLI environments
- Breaking changes require Dart 3.13+
- Limited to server utilities, not a full web framework
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
import 'dart:io';
import 'package:belatuk_http_server/belatuk_http_server.dart';
Future<void> main() async {
var server = await HttpServer.bind(InternetAddress.loopbackIPv4, 8080);
var handler = VirtualDirectory(server);
await handler.serve();
}Alternatives
Packages that do the same job and could replace belatuk_http_server.
- http
General purpose client‑side HTTP library, but also provides HttpServer utilities
86Compare - http_multi_server
Offers multi‑isolate HttpServer handling, useful for scaling
90Compare - shelf_proxy
Provides middleware‑style request handling for Dart servers
86Compare
Works with
Packages commonly used together with belatuk_http_server: ones it builds on, ones built on it, and its own family.