Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

trying out shorty as a groove app

  • Loading branch information...
commit 7a052b2b8ac76ea453d6c215e3cf82f09080092b 1 parent 35a2934
Dan Croak authored December 31, 2009
2  .gitignore
... ...
@@ -1,4 +1,4 @@
1 1
 *.swp
2 2
 *.swo
3 3
 *.db
4  
-webrat.log
  4
+*.log
16  shorty.rb → app.rb
... ...
@@ -1,18 +1,3 @@
1  
-require 'rubygems'
2  
-require 'sinatra'
3  
-require 'mongo'
4  
-
5  
-include Mongo
6  
-
7  
-DB = Connection.new(ENV['DATABASE_URL'] || 'localhost').db('shorty')
8  
-if ENV['DATABASE_USER'] && ENV['DATABASE_PASSWORD']
9  
-  auth = DB.authenticate(ENV['DATABASE_USER'], ENV['DATABASE_PASSWORD'])
10  
-end
11  
-
12  
-configure :production do
13  
-  enable :raise_errors
14  
-end
15  
-
16 1
 get '/' do
17 2
   <<-HTML
18 3
     <title>URL shortener</title>
@@ -20,7 +5,6 @@
20 5
       <input type="text" name="url" />
21 6
       <input type="submit" value="shorten" />
22 7
     </form>
23  
-    <p>Written in Sinatra and MongoDB.</p>
24 8
   HTML
25 9
 end
26 10
 
7  config.ru
... ...
@@ -1,6 +1,3 @@
1  
-require 'shorty'
2  
-require 'rack_hoptoad'
3  
-
4  
-use Rack::HoptoadNotifier, ENV['HOPTOAD'] || "1234"
5  
-
  1
+require 'groove'
  2
+require 'app'
6 3
 run Sinatra::Application

0 notes on commit 7a052b2

Please sign in to comment.
Something went wrong with that request. Please try again.