listen static method
Implementation
static Future<StreamSubscription<HttpRequest>> listen(
{int port = 4040,
String host = '0.0.0.0',
dynamic onStart,
dynamic onComplete}) async {
var server = await HttpServer.bind(host, port);
logger('Listening on http://$host:$port/', 'I');
return server.listen((request) async {
var api = Dartive(request);
// print("the request is ${request}");
try {
var x = api.handle();
print(x);
} catch (e, t) {
logger('Request.Error [${api.uri}] $e,$t', 'E');
}
});
}