Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactored design away from manipulating the prototype change o…
…f the request/response pair BREAKING CHANGE: This design changes the Express app from a Function to a Class which has many impacts. One example is when creating the applicatio n. This design introduces 3 main classes, ExpressApp, ExpressResponse, and ExpressRequest. The req/res pair are now instances of ExpressRequest/Response, which extend the http.IncomingMessage/ServerResponse. I tried several approaches to removing the prototype chain design, this one was the only one where I was able to successfully change the design and tests still pass (except for the ones that tested the prototypical features). ```javascript const app = express() const server = app.listen() ``` Some things you used to be able do that you can no longer do are: ```javascript express.response.foo = function() { this.send('bar') } ``` Checkout the Exports.mjs test to see how to accomplish the same thing with the new design.
- Loading branch information