#
# content/doc/misc/_psgi-app.pl
# =============================================================================
# PSGI application template.
# Usage:
#     $ uwsgi --http :8765 --http-modifier1 5 --psgi _psgi-app.pl
#     $ curl localhost:8765
# =============================================================================
# See for ref.: https://uwsgi-docs.readthedocs.io/en/latest/PSGIquickstart.html
#

use strict;
use warnings;
use utf8;
use v5.10;

use constant TXT => "\nPSGI application template.\n";

use constant {
    HDR_CONTENT_TYPE => "text/plain",
    RSC_HTTP_200_OK  => 200,
};

# The application entry point.
my $app = sub {
    my $env = shift();

    my $resp = ["Content-Type" => HDR_CONTENT_TYPE];
    my $_txt = [$env, TXT];

    return [RSC_HTTP_200_OK, $resp, $_txt];
};

# vim:set nu et ts=4 sw=4:

Add PSGI app template to play with uWSGI server.
Add PSGI app template to play with uWSGI server.
