Created
February 25, 2014 20:53
-
-
Save bdkosher/9217498 to your computer and use it in GitHub Desktop.
Vert.x HTTP sever for running https://github.com/SarvagyaVaish/FlappyBirdRL
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
// store Groovy script in directory where ZIP was extracted | |
// run vertx run FlappyBird.groovy | |
def root = /FlappyBirdRL-master/ | |
vertx.createHttpServer().requestHandler { req -> | |
def file = java.net.URLDecoder.decode(req.uri == "/" ? "index.html" : req.uri, 'UTF-8') | |
req.response.sendFile "$root/$file" | |
}.listen(8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment