Define router by using an array with FR or IR


#1
features = [
    'books'
    'authors'
    'orders'
]

for feature in features

    FlowRouter.route "/#{feature}",
        @action: ->
            console.log feature

these code will define router, but
all path are render the last item of array

is there any possible to auto generate router ?


#2

Hope you are using Coffee-script.

Technically, it’s possible to do anything you want with the router code. You can automatically create routes. This is possible with both IR and FR.