[ckan-dev] RFC: routes - named routes and redirects

Sean Hammond sean.hammond at okfn.org
Tue Sep 4 08:34:33 UTC 2012


> named routes
> --------------------
> sometimes we use named routes eg
>     m.connect('storage_api', '/api/storage', action='index')
> 
> Sometimes not eg
>     m.connect('/feeds/group/{id}.atom', action='group')
> 
> personally I'd remove all named routes and just use the controller=..,
> action=.. approach

Definitely, no sense in making up additional names, just makes things
harder to grep.

> redirects
> -------------
> 
> sometimes we do redirects like
>     map.redirect('/users/{url:.*}', '/user/{url}')
> 
> Do we really want to encourage the use of multiple urls going to the same
> place - some such as
>     map.redirect('/package/{url:.*}', '/dataset/{url}')
> 
> are needed for backwards compatibility (but for how long?)- and in this
> case because the ckanclient was never updated but do we want to do this?
> The users example above is really bad because /users/moo works but /users
> gives a 404
> 
> While I'd like to see these removed from routes how about as part of 2.0
> I'm really keen we don't add more.  What do the rest of you think?

Why are the /users/* URLs supported? Yeah I agree having multiple URLs
for the same thing is the beginning of a messy situation.

By the way it looks like we're heading for something similar with /group
and /organization (perhaps we should support /organisation as well!)




More information about the ckan-dev mailing list