blib/lib/WebDyne/PAGI/Constant.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 34 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #
2 # This file is part of WebDyne.
3 #
4 # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 # Full license text is available at:
10 #
11 # <http://dev.perl.org/licenses/>
12 #
13  
14  
15 #
16 #
17 package WebDyne::PAGI::Constant;
18  
19  
20 # Pragma
21 #
22 use strict qw(vars);
23 use vars qw($VERSION @ISA %Constant);
24 use warnings;
25 no warnings qw(once);
26  
27  
28 # External modules
29 #
30 use File::Basename;
31  
32  
33 # Does the heavy liftying of importing into caller namespace
34 #
35 require WebDyne::Constant;
36 @ISA=qw(WebDyne::Constant);
37  
38  
39 # Version information
40 #
41 $VERSION='3.029';
42  
43  
44 # Hash of constants
45 # <<<
46 %Constant=(
47  
48  
49 # Document Root, usually supplied as env var or command line option but
50 # can be set here.
51 #
52 DOCUMENT_ROOT => undef,
53
54
55 # Document default - will be served if exists in DOCUMENT_ROOT and no other
56 # file specified.
57 #
58 DOCUMENT_DEFAULT => 'app.psp',
59  
60
61 # Middleware config, static module. Enable per app with static => 1
62 # or globally by setting WEBDYNE_PAGI_STATIC.
63 #
64  
65  
66 # Serve any static file except .psp
67 #
68 #WEBDYNE_PSGI_MIDDLEWARE_STATIC => qr{^(?!.*\.psp$).*\.\w+$},
69 #
70 # Just common files
71 #
72 WEBDYNE_PAGI_MIDDLEWARE_STATIC => qr{\.(?:css|js|jpg|jpeg|png|gif|svg|ico|woff2?|ttf|eot|otf|webp|map|txt|inc|htm|html)$}i,
73
74
75 # Serve static files ?
76 #
77 WEBDYNE_PAGI_STATIC => 0,
78
79
80 # All other middleware. Uncomment/modify as required
81 #
82 WEBDYNE_PAGI_MIDDLEWARE => [
83
84 #[ 'Debug' =>
85 # { enabled => 1 }
86 #],
87
88 # If given as a sub code ref then option hash ref is first param
89 #
90 [ 'Static' => sub {
91 { path=>$WebDyne::PAGI::WEBDYNE_PAGI_MIDDLEWARE_STATIC, root=>(-f $_[0]->{'root'}) ? dirname($_[0]->{'root'}) : $_[0]->{'root'}, pass_through=>1 }
92 }]
93
94
95 ],
96
97
98 # Environment variables to keep, needs to be array ref
99 #
100 WEBDYNE_PAGI_ENV_KEEP => [qw(DOCUMENT_ROOT DOCUMENT_DEFAULT)],
101 WEBDYNE_PAGI_ENV_SET => {},
102
103
104 # Warn on error ?
105 #
106 WEBDYNE_PAGI_WARN_ON_ERROR => undef,
107
108
109 # Modules to load on eval
110 #
111 WEBDYNE_PAGI_EVAL_PREPEND => << 'END'
112 use Future::AsyncAwait;
113 #use Future::IO;
114 END
115 ,
116  
117  
118 );
119 # >>>
120  
121  
122 # Done
123 #
124 1;
125 __END__