[dancer-users] Reaching a route defined at another .pm file

Kadir Beyazlı kadirbeyazli at gmail.com
Sun Sep 13 13:43:09 BST 2015


Hi All,

At my project all routes are defined at same file : myproject.pm as follow:

get /product {

}

get /store {

}

get /user {

}

Then I decided to put each logical item into separate file as follow,
for example I created Product.pm for product operations.

#Product.pm
package Product;
use Dancer2;

get /product {

}


At file myproject.pm I added package Product as follow and removed
route from this file

myproject.pm

package myproject;
use Dancer2;
use Dancer2::Plugin::Database;
use Product;

But it can not find get /product route which was working when it was
at myproject.pm

How can I do it?

-- 
Kadir Beyazlı
GSM : +90 535 821 50 00


More information about the dancer-users mailing list