import Vue from 'vue'
import Router from 'vue-router'
import routes from './cases'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL || '/',
  routes: [
    {
      path: '/',
      name: 'Empty',
      component: {
        name: 'empty',
        render (h) {
          return h('article', [
            h('h1', 'Welcome to VEUI!'),
            h('p', '← Select a demo from the nav bar to get started.')
          ])
        }
      }
    },
    ...routes
  ]
})

import Vue from 'vue'
import Router from 'vue-router'
import routes from './cases'

Vue.use(Router)

export default new Router({
  mode:
    process.env.BASE_URL && process.env.BASE_URL !== '/' ? 'hash' : 'history',
  base: process.env.BASE_URL || '/',
  routes: [
    {
      path: '/',
      name: 'Empty',
      component: {
        name: 'empty',
        render (h) {
          return h('article', [
            h('h1', 'Welcome to VEUI!'),
            h('p', '← Select a demo from the nav bar to get started.')
          ])
        }
      }
    },
    ...routes
  ]
})

use hash mode if base_url is not root