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>
18 lines
443 B
Dart
18 lines
443 B
Dart
import 'dart:io';
|
|
|
|
import 'package:gametime_server/api/router.dart';
|
|
import 'package:shelf/shelf_io.dart' as shelf_io;
|
|
|
|
Future<void> main(List<String> arguments) async {
|
|
final port = int.tryParse(Platform.environment['PORT'] ?? '') ?? 8080;
|
|
final server = await shelf_io.serve(
|
|
buildApiHandler(),
|
|
InternetAddress.anyIPv4,
|
|
port,
|
|
);
|
|
|
|
print(
|
|
'GameTime server listening on ${server.address.address}:${server.port}',
|
|
);
|
|
}
|