1

I am facing a problem finding the request and response objects given by ExpressJS. I made an endpoint in /server/boot/root.js like bellow. I don't want this endpoint to bind with any model.

  router.get('/playing/:param1/:param2',function(ctx){
    console.log(ctx.req); // prints undefined
  } );

How to get the regular ExpressJS request and response object so that I can handle this by my own will?

Nur Rony
  • 7,823
  • 7
  • 38
  • 45

1 Answers1

0

I have added custom routes with

router.get('/playing/:param1/:param2',function(req,res){
    var param1 = req.params.param1;
    var param2 = req.params.param2;
    console.log(param1,param2); // should print something
});

and I did it inside /server/boot/root.js so that should be fine.

ffflabs
  • 17,166
  • 5
  • 51
  • 77