Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Created February 25, 2014 20:53
Show Gist options
  • Save bdkosher/9217498 to your computer and use it in GitHub Desktop.
Save bdkosher/9217498 to your computer and use it in GitHub Desktop.
Vert.x HTTP sever for running https://github.com/SarvagyaVaish/FlappyBirdRL
// 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