Flowrouter, how to get response and request http object

Hi,

flowrouter, how to get response and request http object?

I have this code (from a Single sign on module, a reporting tool which forwards the incoming request to an authentication module --> this meteor project…)

`requestTicket: function (req, res, profile, options) {

    if (!options)
        var options = {};

    //Get and verify parameters
    options.Certificate = options.Certificate || 'client.pem';
    options.CertificateKey = options.CertificateKey || 'client_key.pem';
    options.PassPhrase = options.PassPhrase || '';
    options.ProxyRestUri = options.ProxyRestUri || url.parse(req.url, true).query.proxyRestUri;
    options.TargetId = options.TargetId || url.parse(req.url, true).query.targetId;

    if (global.qlikAuthSession) {
        options.ProxyRestUri = global.qlikAuthSession.proxyRestUri;
        options.TargetId = global.qlikAuthSession.targetId;
    }

    if (!options.ProxyRestUri || !options.TargetId || !profile.UserId) {
        res.end('Missing parameters');
        return;
    }`

I suspect now I have to use this package: meteor add meteorhacks:picker

1 Like

Just to follow up – I’ve found that package combined with the body-parser npm package to be an easy way to handle server-side routes, webhooks, etc.

1 Like