question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to pass additional parameters to the template

See original GitHub issue

It would be nice to have an option to add a method that wraps the data passed to the page-renderer, providing the req. Something to the effect of:

const errorDataHandler = (data, req) => {
    data.body = req.body
    data.redirectTo = req.host
}
 await httpErrorPages.express(this.app, {
            errorDataHandler,
            lang: 'en_US',
            footer: `hello <strong>world</strong>`,
        })

I can include changes to express.js to demonstrate how I think this could work and provide that in a PR to be examined alongside this issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AndiDittrichcommented, Nov 15, 2020

the req and ctx variables can be exposed to the filter callback of v3

0reactions
KenEuckercommented, Nov 15, 2020

@AndiDittrich Awesome, thank you so much, v3 is great! 🎉 👏 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial - add parameters to template - Azure Resource Manager
Parameters let you customize the deployment by providing values that are tailored for a particular environment. You can pass different values, ...
Read more >
Knockout 3.2.0 - Pass extra parameters within template
I want to use templates to make the view I'm working on cleaner. However, I can't make it, because at the moment I...
Read more >
How to pass parameters to an item template implemented ...
The main idea of the approach I suggest is to add an additional parameter to the Form component and obtain it in the...
Read more >
Create custom parameters for advanced tracking - Google Ads ...
Instructions for setting up custom parameters · Step 1: Choose a level · Step 2: Define your custom parameters · Step 3: Add...
Read more >
Parameters - AWS Cloud Development Kit (AWS CDK) v2
AWS CloudFormation templates can contain parameters —custom values that are supplied at deployment time and incorporated into the template.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found