Advertisement
Guest User

Untitled

a guest
Jun 24th, 2011
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.48 KB | None | 0 0
  1. package App;
  2. use Mojo::Base 'Mojolicious';
  3.  
  4. # This method will run once at server start
  5. sub startup {
  6.   my $self = shift;
  7.  
  8.   # Routes
  9.   my $r = $self->routes;
  10.  
  11.   # Normal route to controller
  12.   my $api = $r->route('/api')->namespace('App::Controller');
  13.   $api->route('/TypeA/TypeB')->via('get')->to(class => 'TypeA::TypeB', action => 'say_hello');
  14.  
  15.   #$api->route('/TypeA/TypeB')->via('get')->to(namespace => 'App::Controller::TypeA::TypeB', action => 'say_hello');
  16. }
  17.  
  18. 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement