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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.