Koa example bypasses built-in response handling
See original GitHub issueThe 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:
- Created 7 years ago
- Reactions:2
- Comments:10 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 😕
@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