Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garethr/sinatra-hello-world
A Hello World style application demonstrating the Sinatra Ruby framework
https://github.com/garethr/sinatra-hello-world
Last synced: 3 months ago
JSON representation
A Hello World style application demonstrating the Sinatra Ruby framework
- Host: GitHub
- URL: https://github.com/garethr/sinatra-hello-world
- Owner: garethr
- Created: 2008-12-27T21:20:42.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2009-01-30T22:51:53.000Z (almost 16 years ago)
- Last Synced: 2024-10-04T12:47:59.991Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 99.6 KB
- Stars: 28
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
Awesome Lists containing this project
README
h2. Introduction
This here application is a glorified Hello World using the "Sinatra":http://sinatra.rubyforge.org/ Ruby web framework. If you're thinking that a hello world example doesn't need a test suite, logging, configuration for multiple web servers and code that will restart it if it runs too hot, you'd be right.
h2. Running
Much of the code included in this example application is concerned with configuration for deploying with various other ruby tools.
h3. Sinatra
Sinatra comes with it's own web server.
./app.rbh3. Thin
Alternatively you can use an instance of "Thin":http://code.macournoyer.com/thin/.
thin -C configs/config.yml -R configs/config.ru startthin -C configs/config.yml -R configs/config.ru stoph3. God
If you're feeling particularly fancy then you can keep the Thin server up and running with "God":http://god.rubyforge.org/.
First start the god daemon:
sudo godsudo statusThen load your configuration and start the monitor:
sudo god load thin-sinatra-hello-worldsudo god monitor thin-sinatra-hello-worldThen run a few commands to demonstrate everything is in running order.
sudo statussudo god start thin-sinatra-hello-worldsudo god stop thin-sinatra-hello-worldh2. Testing
So far you run a few very simple tests, either with unittest or with "RSpec":http://rspec.info/.
To run the unit tests simply run:
rakeTo run the RSpec tests run:
rake spec