Skip to content

Instantly share code, notes, and snippets.

@ezhov-da
Last active March 10, 2019 12:15
Show Gist options
  • Save ezhov-da/23fede72d2ad3db838950940667e7cb8 to your computer and use it in GitHub Desktop.
Save ezhov-da/23fede72d2ad3db838950940667e7cb8 to your computer and use it in GitHub Desktop.
сервер 10 линий
[http://voituk.kiev.ua/2007/08/26/simple-http-server-in-10-lines-of-groovy-code-en/]
[Web2.groovy]
if (init)
data = "";
if (line.size() > 0) {
data += line + "\n"
} else {
println "HTTP/1.0 200 OK\n"
println data
return "success"
}
$ groovy -l 8000 Web2.groovy
groovy is listening on port 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment