Wednesday 24 May 2017

modify response in express/nodejs

i am making multiple streamdata in Nodejs using express.

this is how i make a url:

app.get('/temp/1', function(req, res){
  res.send('hello, i am not modified')
})

my question is: is it possible to modify the response of that url?

i tried like this:

app.get(/modify/1, function(req, res){  
    app.get('/temp/1', function(req, res){
       res.send('hello, i am modified')
    })    
  res.send('done');
}

So i would think that the response is changed, but nothing happens actually. is there a way to achieve it?



via user2959870

No comments:

Post a Comment