Commits

Tarek Ziadé committed 5bee103

few tweaks

Comments (0)

Files changed (1)

 from cornice import Service
 from webob import exc
 
+
+redirect = Service(name='redirect', path='/{key}', description="Redirect")
 short = Service(name='shortener', path='/', description="URL Shortener")
-redirect = Service(name='redirec', path='/{key}', description="URL Shortener")
 
 
 def auth(request):
     return {'short': short}
 
 
+@short.get(renderer='string')
+def home(request):
+    return 'Welcome to err.li'
+
+
 @redirect.get()
 def get_url(request):
     """Adds a shortened URL."""
     try:
         url = request.registry['storage'].get_redirect(key)
     except KeyError:
+        request.matchdict = None  # XXX o/wise cornice throws a 405
         raise exc.HTTPNotFound()
 
     return exc.HTTPFound(location=url)