Basic structure and courses api
This commit is contained in:
parent
1c60f68c62
commit
9f4eb7f79a
5 changed files with 71 additions and 0 deletions
1
bin/packages
Symbolic link
1
bin/packages
Symbolic link
|
@ -0,0 +1 @@
|
|||
../packages
|
22
bin/titama.dart
Normal file
22
bin/titama.dart
Normal 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}');
|
||||
}
|
Reference in a new issue