Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7980079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:57:32+00:00 2026-06-04T09:57:32+00:00

I am trying to write a routing framework of nodejs, I need to add

  • 0

I am trying to write a routing framework of nodejs, I need to add some helper methods for ServerRequest and ServerResponse. I notice express has change it way from modify prototype to

express/response.js

var res = module.exports = {
  __proto__: http.ServerResponse.prototype
};

res.redirect = function (url) {
  ...
}

And express/middlewares.js

expressInit = function(req, res, next) {
  // ...
  res.__proto__ = app.response;
  next()
}

But in my framework, I just like to do it simple:

http.ServerResponse.prototype.redirect = function(url) {
  ...
}

I don’t know if there is something I don’t know of why express change the style of override.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:57:36+00:00Added an answer on June 4, 2026 at 9:57 am

    Note that the __proto__ pseudo-attribute is non-standard so it’s use was never really appropriate; moreover, it is now considered “deprecated” according to the Mozilla Developer Network (MDN).

    However, the prototype property of Functions is a standard part of the language and its use is always safe.

    Always use MyFunction.prototype, never use myObject.__proto__.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a pretty print routing for dbx on solaris to
I'm trying to write a simple tracking routine to track some points on a
I am trying to write a generic comparison routine. However, some of the items
I'm trying to add URL routing to a web application running in Tomcat 5.5.
I'm trying to write a little program that will add mDNS CNAME aliases to
0x80040237 Cannot insert duplicate key. I'm trying to write an import routine for MSCRM4.0
I am trying write a function that generates simulated data but if the simulated
Trying to write a couple of functions that will encrypt or decrypt a file
Trying to write out syslog entries containing strings but they don't register. // person.name
Trying to write a chat, like on facebook, I wondered if two clients can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.