Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rawleyfowler/dancer2-controllers
A simple wrapper to clean-up Dancer2 route declarations
https://github.com/rawleyfowler/dancer2-controllers
Last synced: 13 days ago
JSON representation
A simple wrapper to clean-up Dancer2 route declarations
- Host: GitHub
- URL: https://github.com/rawleyfowler/dancer2-controllers
- Owner: rawleyfowler
- License: mit
- Created: 2024-02-14T03:07:29.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-26T20:24:33.000Z (9 months ago)
- Last Synced: 2024-10-11T02:44:54.701Z (about 1 month ago)
- Language: Perl
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dancer2::Controllers
A wrapper for exporting [Dancer2](https://metacpan.org/pod/Dancer2) routes in various controller esq, modules.
Similar to how Spring-Boot declares their routes, except without annotations.
## Example
```perl
package MyApp::Controller;use Moose;
BEGIN { extends 'Dancer2::Controllers::Controller' }
sub hello_world : Route(get => /) {
"Hello World!";
}sub foo : Route(get => /foo) {
"Foo!"
}1;
use Dancer2;
use Dancer2::Controllers;set port => 8080;
controllers( ['MyApp::Controller'] );
dance;
```## License
Dancer2::Controllers is free software, licensed under the MIT license.