This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
titama-backend/bin/titama.dart

23 lines
540 B
Dart
Raw Normal View History

2016-06-13 17:13:02 +02:00
library titama;
import 'dart:io';
import 'package:logging/logging.dart';
import 'package:rpc/rpc.dart';
import '../lib/server/titamaapi.dart';
final ApiServer _apiServer = new ApiServer(prettyPrint: true);
main() async {
Logger.root
..level = Level.INFO
..onRecord.listen(print);
_apiServer.addApi(new TitamaApi());
HttpServer server = await HttpServer.bind(InternetAddress.ANY_IP_V4, 8080);
server.listen(_apiServer.httpRequestHandler);
print('Server listening on http://${server.address.host}:${server.port}');
}