Skip to content

Commit

Permalink
Fix outdated mini_file_server.dart
Browse files Browse the repository at this point in the history
Issue - dart-lang/site-www#2646 - Propose to fix mini server example continuous loop on the connection.
  • Loading branch information
stevenanthonyrevo authored Sep 26, 2020
1 parent d59dfbb commit c4f707e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions httpserver/bin/mini_file_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var targetFile =
File(p.join(p.dirname(Platform.script.toFilePath()), 'index.html'));

Future main() async {
var server;
Stream<HttpRequest> server;

try {
server = await HttpServer.bind(InternetAddress.loopbackIPv4, 4044);
Expand All @@ -39,7 +39,7 @@ Future main() async {
} else {
print("Can't open ${targetFile.path}.");
req.response.statusCode = HttpStatus.notFound;
await req.response.close();
}
await req.response.close();
}
}

0 comments on commit c4f707e

Please sign in to comment.