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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -