Why not adopt me?
NAME
Plack::Middleware::Recorder - Plack middleware that records your client-server interactions
VERSION
version 0.01
SYNOPSIS
use Plack::Builder;
builder {
enable 'Recorder', output => 'requests.out';
$app;
};
DESCRIPTION
This middleware records the stream of requests and responses that your application goes through to a file. See Plack::Util::RequestProcessor for more.
OPTIONS
output
Either a filename, a glob reference, or an IO::Handle where the serialized requests will be written to. To read these requests, use Plack::VCR.
RATIONALE
This module was written to scratch a fairly specific itch of mine, but one I encounter often. I work on a lot of Javascript-heavy web applications for my job, and I often have to fix bugs that only rear their ugly heads a dozen clicks or so into the application. Obviously, if the bug is in the Javascript, there's not much I can do about it, but often the problem comes from the output I receive from the server. This middleware allows me to set up debugging statements in the server and replay the requests the frontend is submitting to get me on the right track.
FURTHER IMPROVEMENTS
The first release of this distribution is fairly simple; it only records and retrieves requests. In the future, I'd like a bunch of features to be added:
Specifying the output as a filename doesn't work properly with CGI (the middleware clobbers the output file)
Recording responses could be useful for generating test scripts and the like.
On that note, a script/convenience module for generating test scripts would be nice.
Currently, authorization works by just copying headers blindly. This logic could be improved with application-specific hooks.
Request bodies are recorded directly in the output stream, and an in-memory representation is used for psgi.input. This could be better.
Others
SEE ALSO
CatalystX::Test::Recorder, https://github.com/miyagawa/Plack-Middleware-Test-Recorder, Plack::VCR
AUTHOR
Rob Hoelz <rob@hoelz.ro>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Rob Hoelz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
BUGS
Please report any bugs or feature requests on the bugtracker website https://github.com/hoelzro/plack-middleware-recorder/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.