Beispiel #1
0
        moduleName = pathArr[3]
      }
    } else {
      require('../components/views/' + pathArr[3].slice(1) + '-container' + '.html')
      moduleName = pathArr[3]
    }
    riot.mount('#app', moduleName  , options)
    // } else {
    //   extraParams.target = extraParams.target || '#app'
    //   riot.mount(extraParams.target, extraParams.page, options)
    // }

    // we need this to easily check the current route from every component
    riot.routeState = {
      view: ''
    }
  } catch (e) {
    console.log(' **** error in routing for view  >> ', pathArr[3])
    console.log('details of error ', e)
    next()
  } finally {
    next()
  }
}

// Apply security filter to Riot-Router
riot.router.use(processorFilter)
riot.mount('*')
// Start routing
riot.router.start()