Skip to content

ironcamel/Dancer-Plugin-Res

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DESCRIPTION

A Dancer plugin that provides syntax sugar for setting the status and returning a response in one shot. This plugin imports the function res().

INSTALLATION

cpan Dancer::Plugin::Res

EXAMPLE

use Dancer;
use Dancer::Plugin::Res;
post '/widgets' => sub {
    return res 400 => to_json { err => 'name is required' }
        unless param 'name';
    # ...
    return res 201, to_json { widget => $widget };
};
dance;

DOCUMENTATION

See Dancer::Plugin::Res. Also, after installation, you can view the documentation via man or perldoc:

man Dancer::Plugin::Res

About

Syntax sugar for setting the status and returning a response.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages