Last active
August 29, 2015 13:57
-
-
Save mplacona/9923089 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
import 'dart:io'; | |
final int port = 5000; | |
final String address = "127.0.0.1"; | |
void main() { | |
HttpServer.bind(address, port) | |
.then((HttpServer server){ | |
print('listening for connections on $port'); | |
server.listen((HttpRequest request) { | |
request.response | |
..statusCode = HttpStatus.ACCEPTED | |
..write("Hi, I'm darty, your friendly little server") | |
..close(); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment