/routes/base.coffee
CoffeeScript | 7 lines | 6 code | 1 blank | 0 comment | 0 complexity | e14531e5c7f2d768a873ef30ed3c78b3 MD5 | raw file
- _ = require 'lodash'
- module.exports = (req, res) ->
- tagIds = _.pluck(req.app.locals.tags, 'id')
- tagIndex = _.random(0, tagIds.length - 1)
- tagId = tagIds[tagIndex]
- res.redirect "/tag/#{tagId}"