Last active
December 18, 2015 17:59
-
-
Save joegiralt/5821999 to your computer and use it in GitHub Desktop.
How to set up the simplest rails rack.
This file contains hidden or 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
require 'rack' | |
class JoeApp #change this name | |
def call(env) | |
puts env['PATH_INFO'] | |
puts env['HTTP_ACCEPT'] | |
body = '<a href="http://students.flatironschool.com/students/joegiralt.html"><font color="pink"><h1>Hello Joe!</h1></font></a>' | |
[200, {'Content-Type' => 'text/html'}, [body]] | |
# [200, {'Content-Type' => 'text/html'}, [<h1>Hello JOE!</h1>]] | |
end | |
end | |
Rack::Handler::WEBrick.run(JoeApp.new, {:Port => 3002}) #you'll need to update this... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment