Another option is to make separate self contained lite apps and mount/embed them together. See https://metacpan.org/pod/Mojolicious::Guides::Routing#Mount-applications and the below embedding section.
-Dan On Mon, Apr 29, 2019 at 6:16 PM Dan Book <gri...@gmail.com> wrote: > No, the Lite DSL can only be imported into one "app" script for the "app". > However, you could call a function and pass it `app` or `app->routes` to > add routes to like a full app would. > > -Dan > > On Mon, Apr 29, 2019 at 2:15 PM Viktor Nacht <viktor.na...@gmail.com> > wrote: > >> I have a fairly simple Mojo app where I just want to spin off the admin >> routes into a module but still use the Mojolicious::Lite syntax. I >> understand I could "grow" the app, but that would add a lot of extra files >> where I really just need to add one file. >> >> Is something like this possible? I tried the "obvious" approach but no >> luck. >> >> use Mojolicious::Lite; >> use MyApp::Admin; >> >> get '/public' >> >> app->start; >> >> package MyApp::Admin; >> >> use Mojolicious::Lite; >> >> get '/admin'; >> >> The route /admin isn't added even though the module is found and >> processed (using FindBin). Any thoughts? >> >> Thank you! >> >> V >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Mojolicious" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to mojolicious+unsubscr...@googlegroups.com. >> To post to this group, send email to mojolicious@googlegroups.com. >> Visit this group at https://groups.google.com/group/mojolicious. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.