Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only use 'template' inside of a request handler is thrown in middleware #73

Open
Altai-man opened this issue Apr 10, 2022 · 0 comments

Comments

@Altai-man
Copy link
Member

My code is:

template-location 'templates';

route {
        after {
            template '404.crotmp', hash if .status == 404;
            template '500.crotmp', hash if .status == 500;
        }
...

and accessing it results in:

Can only use 'template' inside of a request handler
  in sub router-plugin-get-configs at /opt/rakudo-pkg/share/perl6/site/sources/BB802F84B227D34EB41F3FA87E22BD753F6E4033 (Cro::HTTP::Router) line 1373

which sounds a bit too restrictive maybe?

jnthn added a commit to croservices/cro-http that referenced this issue Jul 15, 2022
This should unblock being able to use templates in before/after, as
requseted in croservices/cro-webapp#73.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant