var express = require('express')
var router = express.Router()
const amountPages = [
  'pay-amount-catalogue',
  'pay-amount-openfee',
  'pay-amount-setfee'
]
// Route index page
router.get('/', function (req, res) {
  res.render('index')
})

router.get('/pay-amount', (req, res) => {
  const index = Math.floor(Math.random() * (amountPages.length - 1))
  res.redirect(`/${amountPages[index]}`)
})

// add your routes here

module.exports = router

@@ -284,165 +284,246 @@
 %7B%0A  
-const index = Math.floor(Math.random() * (amountPages.length - 1))%0A  res.redirect(%60/$%7BamountPages%5Bindex%5D%7D%60)%0A%7D)%0A%0A// add your routes here%0A%0Amodule.exports = router
+res.redirect(%60/$%7BamountPages%5BrandomIntFromInterval(0, amountPages.length - 1)%5D%7D%60)%0A%7D)%0A%0A// add your routes here%0A%0Amodule.exports = router%0A%0Afunction randomIntFromInterval (min, max) %7B%0A  return Math.floor(Math.random() * (max - min + 1) + min);%0A%7D
 %0A

bring value from amount select to payment view