Skip to content

Commit

Permalink
Merge pull request #32 from rafalchmiel/master
Browse files Browse the repository at this point in the history
Various inconsistencies fixed
  • Loading branch information
alisnic committed Aug 27, 2013
2 parents f592fa2 + a493a24 commit a940794
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Install the gem:

gem install nyny

Run the file
Run the file:

ruby myapp.rb

Open the browser at [http://localhost:9292]()
Open the browser at [http://localhost:9292](http://localhost:9292)

- [TOP](#new-york-new-york)
- [Motivation](#motivation)
Expand Down Expand Up @@ -68,12 +68,12 @@ as middleware.

# Usage

A NYNY app must _always_ be in a class which inherits from `NYNY::App`.
A NYNY app must _always_ be in a class which inherits from `NYNY::App`:

class App < NYNY::App
get '/' do
'Hello, World'
end
get '/' do
'Hello, World'
end
end

## Running
Expand All @@ -82,14 +82,16 @@ There are two ways to run a NYNY app __directly__ [[?]](#middleware):
- by requiring it in a `config.ru` file, and then passing it as argument to the
Rack's `run` function:

#config.ru
# config.ru
require 'app'
run App.new

- by using the `run!` method directly on the app class:

#app.rb
#...App class definition...
# app.rb
# ...app class definition...

App.run!

Expand All @@ -115,7 +117,7 @@ NYNY also suports basic URL patterns:

class App < NYNY::App
get '/greet/:first_name/:last_name' do
# The last expression in the block is _always_ considered the response body.
# the last expression in the block is _always_ considered the response body.
"Hello #{params[:first_name]} #{params[:last_name]}!"
end
end
Expand Down Expand Up @@ -190,7 +192,7 @@ NYNY also supports middleware itself, and that means you can use Rack middleware
(or a Sinatra app) inside a NYNY app:

class App < NYNY::App
#this will serve all the files in the "public" folder
# this will serve all the files in the "public" folder
use Rack::Static :url => ['public']
use SinatraApp
end
Expand All @@ -212,7 +214,6 @@ definition block.
# F. A. Q.
TBD.


# Contributing

1. Fork it
Expand Down

0 comments on commit a940794

Please sign in to comment.