Skip to content

Instantly share code, notes, and snippets.

@avoronov
Created February 24, 2011 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avoronov/841917 to your computer and use it in GitHub Desktop.
Save avoronov/841917 to your computer and use it in GitHub Desktop.
# Routes
my $r = $self->routes;
$r->route('/login')->to('auth#login');
my $auth = $r->bridge('/')->to('auth#check');
my $reports = $auth->route('/reports')->to('reports#');
$reports->route('/my')->to('#my');
# default route
$r->route('/')->to(
cb => sub {
shift->render_json({status => ERROR, code => BAD_COMMAND});
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment