import Vue from 'vue'
import Router from 'vue-router'
import AuthEntry from './authEntry'
import AuthGuard from './authGuard'

import SearchHome from '@/registry/components/search/SearchHome.vue'
import PersonDetail from '@/registry/components/people/PersonDetail.vue'
import ApplicationDetail from '@/registry/components/people/ApplicationDetail.vue'
import PersonEdit from '@/registry/components/people/PersonEdit.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/people/edit/:person_guid',
      name: 'PersonDetailEdit',
      component: PersonEdit,
      beforeEnter: AuthGuard
    },
    {
      path: '/people/:person_guid/applications/:classCode',
      name: 'ApplicationDetail',
      component: ApplicationDetail,
      beforeEnter: AuthGuard
    },
    {
      path: '/people/:person_guid',
      name: 'PersonDetail',
      component: PersonDetail,
      beforeEnter: AuthGuard
    },
    {
      path: '/',
      name: 'SearchHome',
      component: SearchHome,
      beforeEnter: AuthEntry
    }
  ],
  mode: 'history'
})

@@ -51,44 +51,8 @@
 er'%0A
-import AuthEntry from './authEntry'%0A
 impo
@@ -968,66 +968,113 @@
 Home
-,
 %0A    
-  beforeEnter: AuthEntry%0A    %7D%0A  %5D,%0A  mode: 'history
+%7D%0A  %5D,%0A  mode: 'history',%0A  base: process.env.NODE_ENV === 'production' ? '/gwells/registries/' : '/
 '%0A%7D)

add separate base_url for prod build