Skip to content

Commit

Permalink
Merge pull request #48 from vietj/master
Browse files Browse the repository at this point in the history
Better web server Ceylon example
  • Loading branch information
purplefox committed Oct 14, 2014
2 parents 8bcd4d4 + d3a1a47 commit c19c87e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions index.html
Expand Up @@ -370,14 +370,12 @@ <h3 class="highlight_title">Here's an example web-server*</h3>
import io.vertx.ceylon.core { ... }
import io.vertx.ceylon.core.http { ... }
shared class SendFileExample() extends Verticle() {
shared actual void start(Vertx vertx, Container container) {
vertx.createHttpServer().requestHandler(
void(HttpServerRequest req) {
value file = req.path == "/" then "index.html" else req.path;
req.response.sendFile("webroot/``file``");
}
).listen(8080);
}
start(Vertx vertx, Container container) => vertx.createHttpServer().requestHandler(
void (req) {
value file = req.path == "/" then "index.html" else req.path;
req.response.sendFile("webroot/" + file);
}
).listen(8080);
}
</pre>

Expand Down

0 comments on commit c19c87e

Please sign in to comment.