Created
February 15, 2021 01:22
-
-
Save doyle-flutter/e67be0b13c7697cd7845a7eae9bc39b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> _handlerSetting() async => await this.server!.listen((HttpRequest event) async { | |
if (this._handler.isEmpty) return; | |
for (HandlerModel _hmodel in this._handler) { | |
Function? c = _hmodel.cb; | |
String? path = _hmodel.path; | |
String? method = _hmodel.method; | |
if (event.uri.path.toString() == path && event.method == method) { | |
await c!(event, event.response); | |
await event.response.close(); | |
return; | |
} | |
} | |
return; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment