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.

Koa example bypasses built-in response handling

See original GitHub issue

The Koa example uses ctx.respond, but the Koa documentation says: “Note that using this is not supported by Koa. This may break intended functionality of Koa middleware and Koa itself. Using this property is considered a hack and is only a convenience to those wishing to use traditional fn(req, res) functions and middleware within Koa.”

Can this be avoided and if yes, could the example be updated?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
dizlexikcommented, Jul 2, 2017

Bummer that this was closed. I sure would love to see proper Koa support via a more configurable side-effect-free rendering pipeline. Running my hack in production right now doesn’t feel great but I’m forced to do it if I want to use Koa 😕

3reactions
stevegeekcommented, Oct 26, 2017

@dizlexik Thanks for the update. I really wish it was possible to opt out of the response handling in next then the work arounds would not be necessary

Read more comments on GitHub >

github_iconTop Results From Across the Web

Koa example bypasses built-in response handling · Issue #1353
The Koa example uses ctx.respond , but the Koa documentation says: "Note that using this is not supported by Koa.
Read more >
Koa - next generation web framework for node.js
Koa uses http-assert for assertions. ctx.respond. To bypass Koa's built-in response handling, you may explicitly set ctx.respond = false; . Use this ...
Read more >
koa.Application JavaScript and Node.js code examples
How to use. Application. in. koa. Best JavaScript code snippets using koa. ... 200 ctx.respond = false // Bypass Koa's built-in response handling ......
Read more >
Using Callbacks With nodejs in KOA - Stack Overflow
To bypass Koa's built-in response handling, you may explicitly set this.respond = false ;. Use this if you want to write to the...
Read more >
Everything You Need to Know About Koa - Morioh
For example, to add a reference to your database from ctx : ... To bypass Koa's built-in response handling, you may explicitly set...
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