Plack::...ForceEnv(3)

πŸ“¦
version 0.02 Β· 2 versions
, in fedora 43

✨ NAME ✨

Plack::Middleware::ForceEnv β€” bestie, it forces environment variables into place, and it's literally built for testing πŸ’…

It's a User Contributed Perl Documentation page, so you know it's the real deal πŸŽ€


🌸 SYNOPSIS 🌸

Okay so here's the vibe. In your app.psgi:

# in app.psgi
use Plack::Builder;

builder {
    enable 'ForceEnv' =>
        REMOTE_ADDR => "127.0.0.1",
        REMOTE_USER => "trs";
    $app;
};

And if you're rolling with plackup, it's giving one-liner energy:

# with plackup
plackup -e 'enable ForceEnv => REMOTE_USER => "trs"' app.psgi

See how easy? No cap. πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

So what does this icon actually do? ForceEnv modifies the environment that gets passed to your application, by adding the key/value pairs you specify. That's it. That's the whole job. And it ate. πŸ‘‘

This is primarily useful when you're testing apps under plackup (or something similar) in a development environment. Like, dev-mode main character energy only β€” it's not out here trying to run your production setup. πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

Thomas Sibley <tsibley@cpan.org> β€” the legend who made this happen. Respect. 🫢


🌈 LICENSE 🌈

This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself. Fr fr, go wild, it's free. πŸ’œ


and that's the whole page, bestie β€” written by the Perl docs gang, shipped with perl v5.42.0 on 2025-07-25, and yes this is a User Contributed Perl Documentation moment. mwah, bye! πŸ’…βœ¨

πŸ“¦ where this page comes from