3
작은 netflow 수집기 (예 : ntop)에서 작업하고 내 프로그램이 시작될 때 웹 서버를 생성하려고합니다. 외부 웹 서버를 구성하지 않아도됩니다. 포크에서 내 앱을 시작하는 방법을 알아 내는데 어려움이 있습니다. 여기에 내가 뭘하는지입니다 : 나는 다음을 받기를 실행하면분기 된 프로세스에 Mojolicious :: Server 포함하기
#This is basically what the child process is doing.
#running this outside of my fork does the same thing.
use myApp;
use Mojo::Server;
use Mojo::Server::Daemon;
use Mojolicious::Commands;
my $daemon = Mojo::Server::Daemon->new(listen => ['http://*:5656']);
Mojolicious::Commands->start_app('myApp');
myApp.pm는
sub startup
{
my $self = shift();
my $r = $self->routes;
$r->get('/') => sub {
my $self = shift;
$self->render(text => "Howdy!!");
};
}
가 포함되어 있습니다. . .
usage: ./FlowTrack.pl COMMAND [OPTIONS]
Tip: CGI and PSGI environments can be automatically detected very often and
work without commands.
These commands are currently available:
cgi Start application with CGI.
cpanify Upload distribution to CPAN.
daemon Start application with HTTP and WebSocket server.
eval Run code against application.
generate Generate files and directories from templates.
get Perform HTTP request.
.
.
etc
.
내가하려는 일을하는 문서/예제를 찾을 수 없습니다. 나는 올바른 장소를보고 있지 않을 것이라고 확신한다.
* 질문을 입력하면 항상 수정 프로그램의 시드를 심는 것처럼 보입니다 ... * 테디 베어 프로그래밍 ++ – DavidO