Skip to content

Update test-app/bin/main.dart with dart:io V2 #14

Merged
merged 2 commits into from Mar 5, 2013

2 participants

@nfrancois

The demo code has warning with dart:io v1

@sethladd sethladd commented on an outdated diff Mar 5, 2013
test-app/bin/main.dart
- server.listen('0.0.0.0', port);
- print('Server started on port: ${port}');
-
- server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
-
- var resp = JSON.stringify({
- 'Dart on Heroku': true,
- 'Buildpack URL': 'https://github.com/igrigorik/heroku-buildpack-dart',
- 'Environment': Platform.environment}
- );
-
- response.headers.set(HttpHeaders.CONTENT_TYPE, 'application/json');
- response.outputStream.writeString(resp);
- response.outputStream.close();
- };
+ HttpServer.bind('0.0.0.0', port).then((HttpServer server){
@sethladd
Collaborator
sethladd added a note Mar 5, 2013

Please add a space before {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@sethladd
Collaborator
sethladd commented Mar 5, 2013

Thanks! One small nit

@nfrancois

The space before is fixed

@sethladd
Collaborator
sethladd commented Mar 5, 2013

lgtm Thanks!

@sethladd sethladd merged commit 74a7c02 into igrigorik:master Mar 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.