The problem with this solution is that your middleware is pushed to the bottom of the stack. Therefore, the meteor catch handler will always work before your "/ callback".
One very hacky way around this (until the meteorite issues its proper routing support) is to splic your handler at the top of the stack:
__meteor_bootstrap__.app.stack.splice (0, 0, { route: '/hello', handle: function (req,res, next) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end("hello world"); return; }.future () });
wkz Jun 05 2018-12-12T00: 00Z
source share