22 lines
540 B
Dart
22 lines
540 B
Dart
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}');
|
|
}
|