koajs/koa ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Node.js web framework like Koa that makes it easy to write APIs and web apps with async middleware. I want to be able to create an app, register middleware with app.use, and have requests flow through each step so one middleware can do work before and after the next one runs. Please include a simple ctx object for each request, with handy shortcuts for request and response data, and make it easy to set the body, status, headers, and content type.
It should handle the basics people expect from an HTTP server, like normal request and response handling, errors, redirects, and content negotiation, but keep the core very small and clean. Make sure it works with modern Node and supports async functions naturally. Add a few clear examples, including a hello world server and a logger middleware, and include tests so I can see the middleware flow and response handling working correctly. If you need to check current Node docs or best practices, feel free to look them up online.
Are you gonna build this?
make sure you review the code using coderabbit