Document how write a Dancer2 CGI app
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- perl
- Domain
- documentation
Research direction
Start with the CGI application example in the issue and inspect the repository's existing documentation structure to find the appropriate location. Document the demonstrated Dancer2 CGI setup, including the embedded templates, so a reader can follow it as a complete example.
Written by the indexing model from the issue text.
Description
I worked with @xsawyerx today and we figured out how to write a Dancer2 app in CGI. We feel like it should be documented but we're not sure where:
use Dancer2;
use Plack::Loader;
use Template::Provider::FromDATA;
# Tell Dancer to use the DATA section for templates
my $provider = Template::Provider::FromDATA->new( { CLASSES => __PACKAGE__ } );
set engines => {template => { template_toolkit => { LOAD_TEMPLATES => [ $provider ] }}};
set template => 'template_toolkit';
get '/' => sub {
template 'mytemplate' => { bar => "foo" };
};
Plack::Loader->auto->run(main->to_app);
__DATA__
__mytemplate.tt__
Flib [% bar %]
__anothertemplate.tt__
Something else here.
- Dominant language
- Perl
- Stars
- 604
- Forks
- 287
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PerlDancer/Dancer2
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
PerlDancer/Dancer2#1854 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1851 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PerlDancer/Dancer2#1850 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
PerlDancer/Dancer2#1820 ·
-
Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1819 ·
All issues in PerlDancer/Dancer2
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
major/MySQLTuner-perl#1007 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
bioconda/bioconda-recipes#70187 ·
Maintainers usually reply within 2 days
-
documentation Needs Triage
Difficulty 1/5 Under an hour Newbie friendliness 93/100
Maintainers usually reply within 1 day