Permalink
Browse files

trying out shorty as a groove app

  • Loading branch information...
1 parent 35a2934 commit 7a052b2b8ac76ea453d6c215e3cf82f09080092b @croaky committed Dec 31, 2009
Showing with 3 additions and 22 deletions.
  1. +1 −1 .gitignore
  2. +0 −16 shorty.rb → app.rb
  3. +2 −5 config.ru
View
@@ -1,4 +1,4 @@
*.swp
*.swo
*.db
-webrat.log
+*.log
View
@@ -1,26 +1,10 @@
-require 'rubygems'
-require 'sinatra'
-require 'mongo'
-
-include Mongo
-
-DB = Connection.new(ENV['DATABASE_URL'] || 'localhost').db('shorty')
-if ENV['DATABASE_USER'] && ENV['DATABASE_PASSWORD']
- auth = DB.authenticate(ENV['DATABASE_USER'], ENV['DATABASE_PASSWORD'])
-end
-
-configure :production do
- enable :raise_errors
-end
-
get '/' do
<<-HTML
<title>URL shortener</title>
<form action="/shorten" method="post">
<input type="text" name="url" />
<input type="submit" value="shorten" />
</form>
- <p>Written in Sinatra and MongoDB.</p>
HTML
end
View
@@ -1,6 +1,3 @@
-require 'shorty'
-require 'rack_hoptoad'
-
-use Rack::HoptoadNotifier, ENV['HOPTOAD'] || "1234"
-
+require 'groove'
+require 'app'
run Sinatra::Application

0 comments on commit 7a052b2

Please sign in to comment.