|
NAMEDancer::Plugin::CORS::Sharing - Helper class for sharing methodVERSIONversion 0.13DESCRIPTIONIn order to use many rules with many routes, this helpers class helps you to organize yourself.SYNOPSISuse Dancer::Plugin::CORS; sharing->rule( origin => ..., credentials => 1 ); $route = post '/' => sub { ... }; sharing->add($route); METHODSnewA 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(...); rule(%options)This method defines a optionset. See Dancer::Plugin::CORS::share for a explaination of valid options.add(@routes)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(...))); clearThis method clears all previously defined rules.SEE ALSO
1; BUGSPlease report any bugs or feature requests on the bugtracker website https://github.com/zurborg/libdancer-plugin-cors-perl/issuesWhen 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. AUTHORDavid Zurborg <zurborg@cpan.org>COPYRIGHT AND LICENSEThis software is Copyright (c) 2014 by David Zurborg.This is free software, licensed under: The ISC License
Visit the GSP FreeBSD Man Page Interface. |