Pretty bare bones. Install Plack, probably save yourself time in the end if you do it via Task::Plack. Then a file named app.psgi–
#!/usr/bin/env perl use strict; use warnings; use Plack::Request; sub { my $request = Plack::Request->new(+shift); # If the URI starts with /success, it is one. my $success = $request->path =~ m{\A/success\b}; [ 200, [ "Content-Type" => "text/plain" ], [ $success ? 1 : 0 ] ]; }
Then run it with the built in server (there are MANY available, including uWSGI)–
~>plackup HTTP::Server::PSGI: Accepting connections at http://0:5000/
Then visit the port in your browser, probably http://localhost:5000/. Once you see that, try http://localhost:5000/success.
Google for “plack tutorial” (or psgi) to pick up more.
Your questions about configuration and deployment are BIG questions and have thousands of pages of possible answers. You should probably just try to get that example running and in the process you will likely learn enough to start answering some of the follow-up questions for yourself; or at least make your questions specific enough for someone to answer succinctly.
In reply to Re: Web service without a server
by Your Mother
in thread Web service without a server
by rudrakiran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |