Guest User

Untitled

a guest
Feb 16th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import 'dart:io';
  2.  
  3. Future main() async {
  4. var server = await HttpServer.bind(
  5. InternetAddress.loopbackIPv4,
  6. 4040,
  7. );
  8. print('Listening on localhost:${server.port}');
  9.  
  10. await for (HttpRequest request in server) {
  11. request.response
  12. ..write('Hello, world!')
  13. ..close();
  14. }
  15. }
Add Comment
Please, Sign In to add comment