Ajoute le nouveau paquet server/ (architecture hexagonale : api,
domain, application, infrastructure/postgres, infrastructure/security,
migrations, scripts) avec un premier endpoint GET /health. dart pub
get OK, dart analyze clean, dart test 1/1 vert, serveur démarré
manuellement et validé (GET /health -> 200 {"status":"ok"}).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
423 B
Dart
17 lines
423 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:shelf/shelf.dart';
|
|
import 'package:shelf_router/shelf_router.dart';
|
|
|
|
Handler buildApiHandler() {
|
|
final router = Router()
|
|
..get('/health', (Request request) {
|
|
return Response.ok(
|
|
jsonEncode({'status': 'ok'}),
|
|
headers: {'content-type': 'application/json'},
|
|
);
|
|
});
|
|
|
|
return const Pipeline().addMiddleware(logRequests()).addHandler(router.call);
|
|
}
|