Want an agile MVC structured app in Sinatra?
git clone git@github.com:bry4n/sinatra-mvc.git firstapp
-
cd firstapp
-
ruby app.rb
-
go to http://localhost:8080/
Create your own controllers, models, views in app/
directory
-
Controllers:
app/controllers
-
Models:
app/models
-
Views:
app/views
To point the /
to a particular controller, edit configs/routes.rb
Library dependencies as Template engines, Databases, etc.., edit configs/deps.rb
Serve static files (jquery, css, images, downloads), place static files in public/
Write your own extensions (helpers) in helpers/
Test your app in interactive shell, type: script/console
-
RESTful API emitters (JSON, XML, YAML, etc..)
-
script/generate like rails (creating controllers (full CRUD), models, views automatically)
-
gem package
-
sudo gem install shotgun
-
shotgun -O
-
sudo gem install unicorn
-
unicorn -C configs/unicorn.rb
- Thin
- rackup -s thin -p 8080
- Mongrel
- rackup -s mongrel -p 8080