1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
Classy web-development dressed in a DSL (official / canonical repo)
Find a file
2007-09-12 23:44:10 +00:00
examples returns block body if body is never called 2007-09-12 23:44:10 +00:00
files this is it 2007-09-08 23:51:24 +00:00
lib returns block body if body is never called 2007-09-12 23:44:10 +00:00
test returns block body if body is never called 2007-09-12 23:44:10 +00:00
vendor * silence warnings or reload 2007-09-12 06:56:31 +00:00
RakeFile * Pretty Urls 2007-09-11 23:16:35 +00:00
README * README w/MIT 2007-09-11 01:14:00 +00:00

Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.


Using Sinatra is EASY!

WARNING:  Keep a fresh pair of underwear nearby.  You may need them when you see this.

Get running without a file!

ruby -e 'require "sinatra"'  # HIT http://localhost:4567/ and BAM!

now create a file called test.rb (or whatever you fancy) and enter this:

require 'sinatra'

get '/' do
  body 'Hello World!'
end

now run 'ruby test.rb' and refresh your browser

Oh yeah!