javascript - Amending req.options in a sailsjs policy -
i have policy being used randomly assign modified view files sake of split testing. in routes.js file have along lines of:
'/some-page': { controller: 'pagecontroller', action: 'viewpage', locals: { view: 'some-page.handlebars' } } i have policy, splits.js that, if detects split test active on path, amends req.options.locals.view "some-split-test.handlebars". however, when app gets controller req.options.locals.view has reverted value assigned in routes.js (ie "some-page.handlebars"). policy being called , working expected - if log req.options.locals.view @ end, has updated value.
am fundamentally misunderstanding relationship here between policies , controllers , ability manipulate req.options?
Comments
Post a Comment