NAME

Dancer::Plugin::Res - Syntax sugar for setting the status and returning a response

VERSION

version 0.0001

SYNOPSIS

use Dancer;
use Dancer::Plugin::Res;
post '/widgets' => sub {
    return res 400 => 'Sorry, name param is required'
        unless param 'name';
};
dance;

DESCRIPTION

This Dancer plugin provides the keyword res(), which stand for response. Calling return res 400, 'reason' in a route is equivalent to:

status 400;
return 'reason';

AUTHOR

Naveed Massjouni <naveedm9@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Naveed Massjouni.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.