Skip to content

express request and response processing  #5188

@ganeshkbhat

Description

@ganeshkbhat

I see that expressjs app has a stack of Layer object Arrays. Which is the function that is used to pass the

I want to know:

  • When a request is sent from the http client which function is invoked first and how is the stack array functions with middlewares invoked and results passed stepwise?
  • Here is an example app.get(path, [middleware(req, res, next), m2(req, res, next), m3(req, res, next), m4(req, res, next)], handler(req, res)) => which function invokes functions stepwise => [middleware(req, res, next), m2(req, res, next), m3(req, res, next), m4(req, res, next), handler(req, res)]
  • Where is the request and response objects created that is passed as arguments?
  • Where is the response object callback function for send => onfinish/ onend functions which I can use to get the send/ sendfile's response object into a variable for an interceptor?

I am looking for the entry of the request and exit if the response (with the response result).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions