Skip to content

Instantly share code, notes, and snippets.

View jlturner's full-sized avatar

James Lawrence Turner jlturner

View GitHub Profile
@jlturner
jlturner / server.rb
Created February 22, 2015 16:43
Quine Eval Server - An experiment
# Quine Eval Server - An experiment
# =================================
#
# This server, when run, will accept POST requests on the root ('/') where the post body is ruby code to eval.
# This server also makes a copy of its source code, and includes the eval'd statements in the new source.
# Because this is a sinatra server, you can use this to create new routes and build up a web service incrementally while running.
#
# Example post to server using curl:
# curl -vv -XPOST -d 'get "/hi" do ; "hi!" ; end' 'http://localhost:4567'
#