NAME

WebService::Fake - Fake a Web Service

VERSION

This document describes WebService::Fake version 0.006.

SYNOPSIS

use WebService::Fake;

DESCRIPTION

This module is at the heart of the webservice script waf, although you can find the real documentation there.

METHODS

body_expander

my $sub_ref = $obj->body_expander($spec, $config);

Generate a sub reference that can be called to generate a body response. The actual body generated is then subject to pass through the sub reference generated by "body_wrapper".

body_wrapper

my $sub_ref = $obj->body_wrapper($spec, $config);

Generate a wrapper to be applied when generating the body for a response. This allows you to factor all your response boilerplate for the body into one single place.

callback

my $sub_ref = $obj->callback($spec, $config);

Generate a callback function to be installed as a route.

headers_expander

my $sub_ref = $obj->headers_expander($spec, $config);

Generate a wrapper to eventually generate headers for a response.

load_config

my $config = $obj->load_config;

Load the configuration file, which is whatever is pointed by environment variable WEBSERVICE_FAKE or by default file webservice-fake.yml in the current directory. Returns the loaded configuration.

startup

$obj->startup;

Initialization method called by Mojolicious.

BUGS AND LIMITATIONS

Report bugs through GitHub (patches welcome).

SEE ALSO

Foo::Bar.

AUTHOR

Flavio Poletti <polettix@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2016 by Flavio Poletti <polettix@cpan.org>

This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.