[Dancer-users] how to run function from app from command line?
Nick Knutov
mail at knutov.com
Sat Jul 2 08:07:20 CEST 2011
This is a little bit different.
It assumes that
1) app is already running
2) and running on port, not unix socket
3) running on known port
This is usual not true in my case (well, app is running, but on very
different server)
I want to run exactly ./bin/app.pl in command line, but how to tell the
app to run specified function from the command line?
Or should I just add my code to parse $ARGV to app.pl before `dance;` at
the end of script?
02.07.2011 8:39, Gurunandan Bhat пишет:
> If you have wget or curl installed, you could consider:
>
> wget http://localhost:3000/service_function
>
>
>
> On Sat, Jul 2, 2011 at 2:44 AM, Nick Knutov <mail at knutov.com
> <mailto:mail at knutov.com>> wrote:
>
> Hello,
>
> I have a big project running on Dancer. This project has some
> service scripts (to do some cron jobs for example), written as
> functions in this Dancer app, that should have access to all usual
> environment (as called from the web functions have), but I need to
> be able run them from command line.
>
> What is the best way to do it?
>
> Example:
>
> get '/service_func' => {...};
>
> I want to do something like
>
> # ./bin/app.pl <http://app.pl> --run=service_func
>
>
> --
> Best Regards,
> Nick Knutov
> http://knutov.com
> ICQ: 272873706
> Voice: +7-904-84-23-130
> _________________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org <mailto:Dancer-users at perldancer.org>
> http://www.backup-manager.org/__cgi-bin/listinfo/dancer-users
> <http://www.backup-manager.org/cgi-bin/listinfo/dancer-users>
>
>
--
Best Regards,
Nick Knutov
http://knutov.com
ICQ: 272873706
Voice: +7-904-84-23-130
More information about the Dancer-users
mailing list