Skip to content

Instantly share code, notes, and snippets.

@andrijac
Created October 10, 2020 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrijac/2d16071df25aeaff72929a40663369f4 to your computer and use it in GitHub Desktop.
Save andrijac/2d16071df25aeaff72929a40663369f4 to your computer and use it in GitHub Desktop.
Future main() async {
var server = await HttpServer.bind(
InternetAddress.loopbackIPv4,
4040,
);
print('Listening on localhost:${server.port}');
await for (HttpRequest request in server) {
request.response.write('Hello, world!');
await request.response.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment