Guest User

Untitled

a guest
Feb 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. app.get('/test/product/*', [
  2. getProduct(req, res, next), // populates req.locals.productResponse
  3.  
  4. (req, res, next) => {
  5. req.locals.context['product-details-feature'].layout = 'product';
  6.  
  7. if (req.locals.productResponse) {
  8. req.locals.context['product-details-feature'].partial = 'product-details-feature/main';
  9. next();
  10. } else {
  11. req.locals.context['product-details-feature'].partial = 'product-details-feature/product-not-found';
  12. res.sendStatus(500);
  13. }
  14.  
  15. req.locals.context['product-details-feature'].uiBootstrap = JSON.stringify(Object.assign({ properties }, req.locals.productResponse || {}));
  16. }
  17. ]);
Add Comment
Please, Sign In to add comment