SlideShare ist ein Scribd-Unternehmen logo
1 von 108
== Sinatra has taken to the stage with backup from
Matt Gifford
@coldfumonkeh
www.monkehworks.com
“SWING WHEN YOU’RE WINNING”
AN INTRODUCTION TO
SINATRA & RUBY
I build stuff
and I write about building stuff too
WHAT WE’LL COVER:
Getting your first Sinatra project up and running
What is Sinatra?
Brief overview of a Sinatra application structure
Handling routes and formats
Deploying to Heroku *
* other options do exist
LIVE CODE DEMOS?
WHAT COULD POSSIBLY
GO WRONG?
NOT SURE IF I SHOULD BE HERE
OR WATCHING SOMEONE ELSE
WHAT ELSE IS ON?
Using personas in service design - continuously
Mura 6 for developers
Tuüli Aalto-Nyyssonen
Steve Withington
WAIT!
You’re a ColdFusion developer, aren’t you?
And this is a ColdFusion conference, isn’t it?
YES I AM!
(and proud of it)
BACK TO SINATRA
WHY NOT RAILS?
It is awesome though...
Rails is quite large and sometimes too much
monkeh$ rails create [stuff]
Ships with ORM, routes, test suites etc
Easily installed with RubyInstaller(.org)
SO WHY SINATRA?
Doesn’t force any framework
Extremely lightweight
A Domain Specific Language (DSL)
Incredibly quick and simple
(but plays well with others if you want to)
SO WHY SINATRA?
Runs on Rack
Can be a single file web application
Can use a number of JavaScript libraries
Can use a number of template engines
It also means I can show pictures like this...
MORE BOUNCE TO THE OUNCE
DEVELOPMENT IS QUICK!
“simplicityistheultimate
sophistication”
Leonardo da Vinci
SINATRA IS GREAT FOR
REST APIs
Small apps
useful for AJAX calls to data
Keeping your simple application simple
If it gets too big, consider using Rails (or CF)
HOW SIMPLE?
application.rb
require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello World!"
end
THIS SIMPLE!
monkeh$ ruby application.rb
== Sinatra/1.4.2 has taken to the stage on 4567 for development with
backup from Thin
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on localhost:4567, CTRL+C to stop
RUNNING THE APP
IMPRESSIVE, RIGHT?
require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello World!"
end
WHAT’S GOING ON?
require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello World!"
end
WHAT’S GOING ON?
<--- Ruby package manager
require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello World!"
end
WHAT’S GOING ON?
<--- Ruby package manager
<--- Sinatra gem
require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello World!"
end
WHAT’S GOING ON?
<--- Ruby package manager
<--- Sinatra gem
<--- GET request
require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello World!"
end
WHAT’S GOING ON?
<--- Ruby package manager
<--- Sinatra gem
<--- GET request
<--- response
require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello World!"
end
NO RETURN?
<--- the return is implied
get '/hi' do
"Hello World!"
end
ROUTE BLOCKS
<--- this is a route block
A route block is an HTTP method paired with
a URL-matching pattern.
Processing takes place within the block (database calls etc)
and the result is sent to the browser.
REST
Uniform Interface
Client-Server
Cacheable
HATEOAS
Layered System
Stateless
Hypermedia as the Engine
of Application State
SINATRA CAN DO THAT!
Caching
Multiple Routes
Content Types
All HTTP verbs supported
Good times!
REST
get '/' do
.. show something ..
end
post '/' do
.. create something ..
end
put '/' do
.. replace something ..
end
patch '/' do
.. modify something ..
end
delete '/' do
.. annihilate something ..
end
options '/' do
.. appease something ..
end
link '/' do
.. affiliate something ..
end
unlink '/' do
.. separate something ..
end
ROUTES
get '/' do
"Home page"
end
get '/hello' do
"Hello!"
end
get '/hello/:name' do
"Hello! #{params[:name]}"
end
ROUTES
get '/say/*/to/*' do
# matches /say/hello/to/world
params[:splat] # => ["hello", "world"]
end
get '/download/*.*' do
# matches /download/path/to/file.xml
params[:splat] # => ["hello", "world"]
end
get '/download*.*' do |path, ext|
# matches /download/path/to/file.xml
[path, ext] # => ["path/to/file", "xml"]
end
ROUTES
get %r{/hello/([w]+)} do
"Hello, #{params[:captures].first}!"
end
get '/posts.?:format?' do
# matches "/posts " and any extension
# eg "GET /posts.xml" or "GET /posts.json"
end
ROUTES
get '/hi', :agent => /Mozilla/(d.d)sw?/ do
"You’re using Mozilla version #{params[:agent][0]}"
end
get '/hi' do
# matches all non-Mozilla browsers
end
GETTING STARTED
Install Ruby
Bathe in Ruby deliciousness
Create your application file
Install the Sinatra gem
http://rvm.io
monkeh$ rvm install 1.9.3
monkeh$ rvm use --default 1.9.3
monkeh$ rvm use jruby
http://cheat.errtheblog.com/s/rvm
GEMS?
GEMS?
RubyGem distributes libraries
apt-get
Similar in functionality to:
A library is self-contained in a gem
portage
yum
GEMS!
monkeh$ gem install [gem]
monkeh$ gem uninstall [gem]
monkeh$ gem list
monkeh$ gem fetch [gem]
BACK TO SINATRA
INSTALLING
monkeh$ gem install sinatra
monkeh$ gem install shotgun
DEMO TIME
DIRECTORY STRUCTURE
| -- application.rb
SINGLE PAGE APP
application.rb
require 'rubygems'
require 'sinatra'
get '/' do
html = '<form method="post">'
html += '<input type="text" placeholder="Add the URL to shorten here..."'
html += 'name="url" id="url" />'
html += '<input type="submit" value="Shorten!" />'
html += '</form>'
html
end
post '/' do
html = '<p>Thanks for submitting a URL.</p>'
html
end
VIEWS
Multiple template languages available, including:
builder
erb
haml
sass
liquid
markdown
USING VIEWS
application.rb
require 'rubygems'
require 'sinatra'
get '/' do
erb :index
end
post '/' do
erb :index
end
views/index.erb
<form method="post">
<input type="text" placeholder="Add the URL to shorten here..."
name="url" id="url" />
<input type="submit" value="Shorten!" />
</form>
DIRECTORY STRUCTURE
| -- application.rb
| -- views
-- index.erb
LAYOUTS
A template that calls yield to draw in view data
Can also be managed through route blocks
A template called “layout” will be used by default
USING LAYOUTS
views/layout.erb
<!DOCTYPE html>
<html>
<head>
<title>Sinatra Intro</title>
</head>
<body>
<%= yield %>
</body>
</html>
views/index.erb
<form method="post">
<input type="text" placeholder="Add the URL to shorten here..."
name="url" id="url" />
<input type="submit" value="Shorten!" />
</form>
USING LAYOUTS
views/layout.erb
<!DOCTYPE html>
<html>
<head>
<title>Sinatra Intro</title>
</head>
<body>
<%= yield %>
</body>
</html>
views/index.erb
<form method="post">
<input type="text" placeholder="Add the URL to shorten here..."
name="url" id="url" />
<input type="submit" value="Shorten!" />
</form>
DIRECTORY STRUCTURE
| -- application.rb
| -- views
-- index.erb
-- layout.erb
STATIC CONTENT
All static content is stored within a new directory
“public”
This is primarily for
Javascript
CSS
Images
DIRECTORY STRUCTURE
| -- application.rb
| -- views
-- index.erb
-- layout.erb
| -- public
-- css
-- style.css
-- javascript
STATIC CONTENT?
HELPERS
application.rb
helpers do
def random_string(length
)
rand(36**length).to_s(36)
end
def get_site_url(short_url
)
'http://' + request.host + '/' + short_url
end
def generate_short_url(long_url
@shortcode = random_string 5
get_site_url(@shortcode)
end
end
FILTERS
application.rb
# This code will run before each event
# Very useful for debugging parameters sent via the console
before do
puts '[Params]'
p params
end
# This code will run after each event
after do
puts response.status
end
CONFIGURATION
Will run once at startup
Can be used to
set application-wide values and options
perform certain processes per environment
CONFIGURATION
configure do
# All environments
end
configure :production do
# Production only
end
configure :development, :test do
# Development and Test
end
CONFIGURATION
configure do
set :variable, 'foo'
# multiple options
set :variable1 => 'Hello', :variable2 => 'world'
# same as set :option, true
enable :option
# same as set :option, false
disable :option
end
get '/' do
settings.variable? # => true
settings.variable # => 'foo'
end
CONFIGURATION
configure :development do
# very useful for debugging parameters sent via the console
before do
puts '[Params]'
p params
end
end
DATAMAPPER
Same API can talk to multiple datastores
Uses adapters to achieve this
sqlite
mysql
postgresql
DATAMAPPER
Define mappings in your model
Comes bundled with tools to assist with
migration
constraints
transactions
timestamps
validations
...and more!
INCLUDE THE LIBRARY
application.rb
require 'rubygems'
require 'sinatra'
require 'data_mapper' <--- DataMapper gem
CONFIGURATION
application.rb
configure do
# load models
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib"
)
Dir.glob("#{File.dirname(__FILE__)}/lib/*.rb") { |lib|
require File.basename(lib, '.*')
}
DataMapper::setup(:default, "sqlite3://#{Dir.pwd}/myDatabase.db")
DataMapper.finalize
DataMapper.auto_upgrade!
end
MODEL
lib/short_url.rb
class ShortURL
include DataMapper::Resource
property :short_url, String, key: true, unique_index: true, required: true
property :url, Text, required: true
property :created_at, DateTime
property :updated_at, DateTime
end
SAVING DATA
application.rb
def generate_short_url(long_url
@shortcode = random_string 5
su = ShortURL.first_or_create(
{ :url => long_url },
{
:short_url => @shortcode,
:created_at => Time.now,
:updated_at => Time.now
})
get_site_url(su.short_url)
end
GETTING DATA
application.rb
# root page
get '/' do
# get the current object of all links stored
@urls = ShortURL.all;
erb :index
end
views/index.erb
<h1>Serving <%= @urls.count %> links</h1>
GETTING DATA
application.rb
get '/:short_url' do
@URLData = ShortURL.get(params[:short_url])
end
DIRECTORY STRUCTURE
| -- application.rb
| -- views
-- index.erb
-- layout.erb
| -- public
-- css
-- style.css
-- javascript
| -- lib
-- shorturl.rb
CONTENT TYPES
Return content in a number of formats, including
JSON
XML
HTML
monkeh$ gem install json
May need some more gems to process
CONTENT TYPE
application.rb
get '/' do
if params[:url] and not params[:url].empty?
@shortURL = generate_short_url(params[:url])
content_type :json
{
:original_url => params[:url],
:short_url => @shortURL
}.to_json
else
# get the current count of all links stored
@urls = ShortURL.all;
erb :index
end
end
TESTING
WHY?
BECAUSE!
TESTING GEMS
monkeh$ gem install rspec
monkeh$ gem install rack
monkeh$ gem install rack/test
TESTING WITH RSPEC
spec/application_rspec.rb
require_relative '../application.rb'
require 'rack/test'
set :environment, :test
def app
Sinatra::Application
end
describe 'URL Shortening Service' do
include Rack::Test::Methods
it "should load the home page" do
get '/'
last_response.should be_ok
end
end
AUTO TESTING
monkeh$ gem install ZenTest
AUTO TESTING NOTIFICATIONS
monkeh$ gem install autotest-growl
monkeh$ gem install autotest-fsevent
DIRECTORY STRUCTURE
| -- application.rb
| -- views
-- index.erb
-- layout.erb
| -- public
-- css
-- style.css
-- javascript
| -- lib
-- shorturl.rb
| -- spec
-- application_rspec.rb
http://gembundler.com/v1.3/gemfile.html
monkeh$ gem install bundler
Gemfile
source 'https://rubygems.org'
gem 'sinatra'
gem 'json'
gem 'dm-core'
gem 'dm-migrations'
gem 'dm-postgres-adapter'
group :development do
gem 'shotgun'
end
group :production do
gem 'thin'
end
GEMFILE
monkeh$ bundle install
monkeh$ git add Gemfile Gemfile.lock
BUNDLE TIME
CONFIG.RU
Many reasons to use, but especially if..
you are deploying to a different Rack handler
Heroku
Passenger
config.ru
require './application.rb'
run Sinatra::Application
CONFIG.RU
Procfile
web: bundle exec thin -R config.ru start -p $PORT -e $RACK_ENV
PROCFILE
HEROKU DEPLOYMENT
monkeh$ git init
monkeh$ git add .
monkeh$ git commit -m "Initial commit"
monkeh$ heroku create urlshrinkapp
Creating urlshrinkapp... done, stack is cedar
http://urlshrinkapp.herokuapp.com/ | git@heroku.com:urlshrinkapp.git
Git remote heroku added
HEROKU
monkeh$ git push heroku master
Total 19 (delta 2), reused 0 (delta 0)
-----> Ruby/Rack app detected
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs
vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing data_objects (0.10.13)
Installing dm-core (1.2.0)
Installing dm-do-adapter (1.2.0)
Installing dm-migrations (1.2.0)
Installing do_postgres (0.10.13)
Installing dm-postgres-adapter (1.2.0)
Installing eventmachine (1.0.3)
Installing json (1.8.0)
Installing rack (1.5.2)
Installing rack-protection (1.5.0)
Installing tilt (1.4.1)
Installing sinatra (1.4.2)
Using bundler (1.3.2)
Your bundle is complete! It was installed into ./vendor/bundle
Cleaning up the bundler cache.
-----> Discovering process types
Procfile declares types -> web
Default types for Ruby/Rack -> console, rake
-----> Compiled slug size: 3.0MB
-----> Launching... done, v4
http://urlshrinkapp.herokuapp.com deployed to Heroku
To git@heroku.com:urlshrinkapp.git
* [new branch] master -> master
HEROKU
monkeh$ heroku addons:add heroku-postgresql:dev
Adding heroku-postgresql:dev on urlshrinkapp... done, v5 (free)
Attached as HEROKU_POSTGRESQL_BROWN_URL
Database has been created and is available
heroku pg:promote HEROKU_POSTGRESQL_BROWN_URL
Promoting HEROKU_POSTGRESQL_BROWN_URL to DATABASE_URL... done
HEROKU
monkeh$ heroku run console
Running `console` attached to terminal... up, run.2858
irb(main):001:0> require './application.rb'
=> true
irb(main):002:0> DataMapper.auto_upgrade!
=> #<DataMapper::DescendantSet:0x000000035aacf0
@descendants=#<DataMapper::SubjectSet:0x000000035aaca0
@entries=#<DataMapper::OrderedSet:0x000000035aac78
@cache=#<DataMapper::SubjectSet::NameCache:0x000000035aac50
@cache={"ShortURL"=>0}>, @entries=[ShortURL]>>>
irb(main):003:0> exit
HEROKU
monkeh$ heroku open
Opening urlshrinkapp... done
HEROKU
DIRECTORY STRUCTURE
| -- application.rb
| -- views
-- index.erb
-- layout.erb
| -- public
-- css
-- style.css
-- javascript
| -- Gemfile
| -- lib
| -- spec
| -- config.ru
| -- Procfile
BACK TO SINATRA
USEFUL LINKS
http://sinatrarb.com
https://github.com/sinatra/sinatra
http://rvm.io
== Sinatra has ended his set (crowd applauds)

Weitere ähnliche Inhalte

Was ist angesagt?

Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013Puppet
 
Vagrant: Your Personal Cloud
Vagrant: Your Personal CloudVagrant: Your Personal Cloud
Vagrant: Your Personal CloudJames Wickett
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725miguel dominguez
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyLaunchAny
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerGeorge Miranda
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Chu-Siang Lai
 
Quick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantQuick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantJoe Ferguson
 
Usando o Cloud
Usando o CloudUsando o Cloud
Usando o CloudFabio Kung
 
Vagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-inVagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-inJeff Scelza
 
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and OscarWebinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and OscarOlinData
 
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!Puppet
 
Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...
Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...
Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...Atlassian
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsTomas Doran
 
Development with Ansible & VMs
Development with Ansible & VMsDevelopment with Ansible & VMs
Development with Ansible & VMsJeff Schenck
 
Automacao devops
Automacao devopsAutomacao devops
Automacao devopsFabio Kung
 
Small Python Tools for Software Release Engineering
Small Python Tools for Software Release EngineeringSmall Python Tools for Software Release Engineering
Small Python Tools for Software Release Engineeringpycontw
 
Ansible を完全にマスターする
Ansible を完全にマスターするAnsible を完全にマスターする
Ansible を完全にマスターするKeisuke Kamada
 
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Alexander Lisachenko
 

Was ist angesagt? (19)

Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
 
Vagrant: Your Personal Cloud
Vagrant: Your Personal CloudVagrant: Your Personal Cloud
Vagrant: Your Personal Cloud
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)
 
Quick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantQuick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with Vagrant
 
Usando o Cloud
Usando o CloudUsando o Cloud
Usando o Cloud
 
Vagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-inVagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-in
 
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and OscarWebinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
 
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
 
Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...
Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...
Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
 
bivou.ac
bivou.acbivou.ac
bivou.ac
 
Development with Ansible & VMs
Development with Ansible & VMsDevelopment with Ansible & VMs
Development with Ansible & VMs
 
Automacao devops
Automacao devopsAutomacao devops
Automacao devops
 
Small Python Tools for Software Release Engineering
Small Python Tools for Software Release EngineeringSmall Python Tools for Software Release Engineering
Small Python Tools for Software Release Engineering
 
Ansible を完全にマスターする
Ansible を完全にマスターするAnsible を完全にマスターする
Ansible を完全にマスターする
 
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
 

Andere mochten auch

Simple Web Services With Sinatra and Heroku
Simple Web Services With Sinatra and HerokuSimple Web Services With Sinatra and Heroku
Simple Web Services With Sinatra and HerokuOisin Hurley
 
10mentalbarrierstoletgoof 12861929353381 Phpapp01
10mentalbarrierstoletgoof 12861929353381 Phpapp0110mentalbarrierstoletgoof 12861929353381 Phpapp01
10mentalbarrierstoletgoof 12861929353381 Phpapp01ana_ls
 
Ruby and Sinatra's Shotgun Wedding
Ruby and Sinatra's Shotgun WeddingRuby and Sinatra's Shotgun Wedding
Ruby and Sinatra's Shotgun WeddingJamin Guy
 
Coimbra rb | microservic'ing and sinatra
Coimbra rb | microservic'ing and sinatraCoimbra rb | microservic'ing and sinatra
Coimbra rb | microservic'ing and sinatralinkedcare
 
WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?James Russell
 
Message Queues in Ruby - An Overview
Message Queues in Ruby - An OverviewMessage Queues in Ruby - An Overview
Message Queues in Ruby - An OverviewPradeep Elankumaran
 
Lightweight Webservices with Sinatra and RestClient
Lightweight Webservices with Sinatra and RestClientLightweight Webservices with Sinatra and RestClient
Lightweight Webservices with Sinatra and RestClientAdam Wiggins
 

Andere mochten auch (7)

Simple Web Services With Sinatra and Heroku
Simple Web Services With Sinatra and HerokuSimple Web Services With Sinatra and Heroku
Simple Web Services With Sinatra and Heroku
 
10mentalbarrierstoletgoof 12861929353381 Phpapp01
10mentalbarrierstoletgoof 12861929353381 Phpapp0110mentalbarrierstoletgoof 12861929353381 Phpapp01
10mentalbarrierstoletgoof 12861929353381 Phpapp01
 
Ruby and Sinatra's Shotgun Wedding
Ruby and Sinatra's Shotgun WeddingRuby and Sinatra's Shotgun Wedding
Ruby and Sinatra's Shotgun Wedding
 
Coimbra rb | microservic'ing and sinatra
Coimbra rb | microservic'ing and sinatraCoimbra rb | microservic'ing and sinatra
Coimbra rb | microservic'ing and sinatra
 
WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?
 
Message Queues in Ruby - An Overview
Message Queues in Ruby - An OverviewMessage Queues in Ruby - An Overview
Message Queues in Ruby - An Overview
 
Lightweight Webservices with Sinatra and RestClient
Lightweight Webservices with Sinatra and RestClientLightweight Webservices with Sinatra and RestClient
Lightweight Webservices with Sinatra and RestClient
 

Ähnlich wie Build a simple URL shortener with Sinatra

Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Alberto Perdomo
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)True-Vision
 
Your first sinatra app
Your first sinatra appYour first sinatra app
Your first sinatra appRubyc Slides
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )  Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist ) Kensuke Nagae
 
Making Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixMaking Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixDiana Tkachenko
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!cloudbring
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Matt Raible
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725MortazaJohari
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Yevgeniy Brikman
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsCameron Dutro
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and SpeedSalesforce Marketing Cloud
 

Ähnlich wie Build a simple URL shortener with Sinatra (20)

Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Your first sinatra app
Your first sinatra appYour first sinatra app
Your first sinatra app
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
Sinatra
SinatraSinatra
Sinatra
 
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )  Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
 
Making Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixMaking Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch Fix
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails Apps
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
Sprockets
SprocketsSprockets
Sprockets
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 

Mehr von Matt Gifford

Get Grulping with JavaScript Task Runners
Get Grulping with JavaScript Task RunnersGet Grulping with JavaScript Task Runners
Get Grulping with JavaScript Task RunnersMatt Gifford
 
Automating PhoneGap Build
Automating PhoneGap BuildAutomating PhoneGap Build
Automating PhoneGap BuildMatt Gifford
 
Let jQuery Rock Your World
Let jQuery Rock Your WorldLet jQuery Rock Your World
Let jQuery Rock Your WorldMatt Gifford
 
Accessing ColdFusion Services From Flex Applications
Accessing ColdFusion Services From Flex ApplicationsAccessing ColdFusion Services From Flex Applications
Accessing ColdFusion Services From Flex ApplicationsMatt Gifford
 
ColdFusion as a Service
ColdFusion as a ServiceColdFusion as a Service
ColdFusion as a ServiceMatt Gifford
 
OAuth: demystified (hopefully)
OAuth: demystified (hopefully)OAuth: demystified (hopefully)
OAuth: demystified (hopefully)Matt Gifford
 
Darwin Development
Darwin DevelopmentDarwin Development
Darwin DevelopmentMatt Gifford
 

Mehr von Matt Gifford (7)

Get Grulping with JavaScript Task Runners
Get Grulping with JavaScript Task RunnersGet Grulping with JavaScript Task Runners
Get Grulping with JavaScript Task Runners
 
Automating PhoneGap Build
Automating PhoneGap BuildAutomating PhoneGap Build
Automating PhoneGap Build
 
Let jQuery Rock Your World
Let jQuery Rock Your WorldLet jQuery Rock Your World
Let jQuery Rock Your World
 
Accessing ColdFusion Services From Flex Applications
Accessing ColdFusion Services From Flex ApplicationsAccessing ColdFusion Services From Flex Applications
Accessing ColdFusion Services From Flex Applications
 
ColdFusion as a Service
ColdFusion as a ServiceColdFusion as a Service
ColdFusion as a Service
 
OAuth: demystified (hopefully)
OAuth: demystified (hopefully)OAuth: demystified (hopefully)
OAuth: demystified (hopefully)
 
Darwin Development
Darwin DevelopmentDarwin Development
Darwin Development
 

Kürzlich hochgeladen

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Kürzlich hochgeladen (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Build a simple URL shortener with Sinatra