Basic structure and courses api

This commit is contained in:
Marcel Kapfer (mmk2410) 2016-06-13 17:13:02 +02:00
parent 1c60f68c62
commit 9f4eb7f79a
5 changed files with 71 additions and 0 deletions

1
bin/packages Symbolic link
View file

@ -0,0 +1 @@
../packages

22
bin/titama.dart Normal file
View file

@ -0,0 +1,22 @@
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}');
}