GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Dancer::Plugin::CORS::Sharing(3) User Contributed Perl Documentation Dancer::Plugin::CORS::Sharing(3)

Dancer::Plugin::CORS::Sharing - Helper class for sharing method

version 0.13

In order to use many rules with many routes, this helpers class helps you to organize yourself.

    use Dancer::Plugin::CORS;

        sharing->rule(
                origin => ...,
                credentials => 1
        );
        
        $route = post '/' => sub { ... };
        
        sharing->add($route);

A convient way is to use the implicit form of the module. This means you don't have to call new() self, just start with defining rules and add routes.

When you want more than one ruleset, obtain a new instance by calling new():

        my $sharing = sharing->new;
        $sharing->rule(...);
        $sharing->add(...);

This method defines a optionset. See Dancer::Plugin::CORS::share for a explaination of valid options.

This method finally calls Dancer::Plugin::CORS::share for any route. @routes maybe a list of arrayrefs of Dancer::Route objects or paths.

Note: Dancer::Plugin::CRUD::resource returns a hash instead of a list. Use values() to obtain the route objects:

        sharing->add(values(resource(...)));

This method clears all previously defined rules.

Dancer::Plugin::CORS

1;

Please report any bugs or feature requests on the bugtracker website https://github.com/zurborg/libdancer-plugin-cors-perl/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.

David Zurborg <zurborg@cpan.org>

This software is Copyright (c) 2014 by David Zurborg.

This is free software, licensed under:

  The ISC License
2014-11-25 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.