Created
June 1, 2012 03:31
-
-
Save keroger2k/2848476 to your computer and use it in GitHub Desktop.
Skeleton Sinatra Application
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
| module Hotel | |
| class App < Sinatra::Base | |
| get "/" do | |
| "Hello world, it's #{Time.now} at the server!" | |
| end | |
| end | |
| end |
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
| $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__)) | |
| require "rubygems" | |
| require "bundler/setup" | |
| require 'sinatra/base' | |
| require 'mustache/sinatra' | |
| require 'hotel' | |
| require 'app' |
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 File.expand_path(File.dirname(__FILE__) + '/app/boot') | |
| map('/') { run Hotel::App } |
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
| source 'http://rubygems.org' | |
| gem 'rack' | |
| gem 'rake' | |
| gem 'sinatra' | |
| gem 'mustache' | |
| gem 'foreman' | |
| gem 'thin' | |
| group :test do | |
| gem 'rack-test' | |
| gem 'mocha', '~>0.11.1' | |
| end |
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
| module Hotel | |
| end |
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
| web: bundle exec thin start -p 5050 |
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 'rubygems' | |
| require 'rake' | |
| $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/app') | |
| require 'boot' | |
| desc "Start the server" | |
| task :start do | |
| Kernel.exec "bundle exec foreman start" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment