Alright, just for fun I’m kicking off a new blog series. I’m going to publish a new “Deploy a Framework Friday” each week for about the next, well, bunch of weeks. There are a TON of frameworks that are available on PaaS Technologies.
This first entry I’m going to implement a simple Sinatra app with Ruby. Nothing fancy, simply a hello world and the respective deployment to a Cloud Foundry PaaS.
First, let’s whip out the super complex code (right, this isn’t complex, I just like sarcasm). The hello.rb file I created.
require 'sinatra' get '/' do "Hello World!" end get '/route' do "Hello from a route URI!" end
Next add a Gemfile & respective Gemfile.lock as such.
source "http://rubygems.org" gem 'sinatra'
GEM remote: http://rubygems.org/ specs: rack (1.4.1) rack-protection (1.2.0) rack sinatra (1.3.2) rack (~> 1.3, >= 1.3.6) rack-protection (~> 1.2) tilt (~> 1.3, >= 1.3.3) tilt (1.3.3) PLATFORMS ruby DEPENDENCIES sinatra
Then deploy using the Cloud Foundry VMC.
If you’ve forgotten, be sure to target and login first.
vmc target api.ironfoundry.me vmc login
That does it. Yeah, not a whole lot to get started working on a Sinatra Project. For more information on Sinatra check out the main web presence here http://www.sinatrarb.com/.
Next week I’ll do a baseline ASP.NET MVC 4 Application and get it deployed.