{"size": 2866, "ext": "js", "max_stars_repo_path": "src/router/index.js", "max_stars_repo_name": "samet-alaca/nelva-vue", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/router/index.js", "max_issues_repo_name": "samet-alaca/nelva-vue", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/router/index.js", "max_forks_repo_name": "samet-alaca/nelva-vue", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.8252427184, "max_line_length": 57, "alphanum_fraction": 0.4064898814}
import Vue from 'vue';
import Router from 'vue-router';
import { CHECK_AUTH } from '@/store/actions.type';
import store from '@/store'

Vue.use(Router);

export default new Router({
    mode: 'history',
    routes: [
        {
            name: 'home',
            path: '/',
            component: () => import('@/views/Home')
        },
        {
            name: 'join',
            path: '/join',
            component: () => import('@/views/Join')
        },
        {
            name: 'users',
            path: '/users',
            component: () => import('@/views/Users'),
            beforeEnter: (to, from, next) => {
                store.dispatch(CHECK_AUTH).finally(next);
            }
        },
        {
            name: 'user',
            path: '/users/:id',
            component: () => import('@/views/User'),
            beforeEnter: (to, from, next) => {
                store.dispatch(CHECK_AUTH).finally(next);
            }
        },
        {
            name: 'academy',
            path: '/academy',
            component: () => import('@/views/Academy')
        },
        {
            name: 'military',
            path: '/academy/military',
            component: () => import('@/views/Military')
        },
        {
            name: 'economy',
            path: '/academy/economy',
            component: () => import('@/views/Economy')
        },
        {
            name: 'diplomacy',
            path: '/academy/diplomacy',
            component: () => import('@/views/Diplomacy')
        },
        {
            name: 'leadership',
            path: '/academy/leadership',
            component: () => import('@/views/Leadership')
        },
        {
            name: 'nexus',
            path: '/nexus',
            component: () => import('@/views/Nexus'),
            beforeEnter: (to, from, next) => {
                store.dispatch(CHECK_AUTH).finally(next);
            }
        },
        {
            name: 'document',
            path: '/nexus/:slug',
            component: () => import('@/views/Document'),
            beforeEnter: (to, from, next) => {
                store.dispatch(CHECK_AUTH).finally(next);
            }
        },
        {
            name: 'cinelva',
            path: '/cinelva',
            component: () => import('@/views/Cinelva'),
            beforeEnter: (to, from, next) => {
                store.dispatch(CHECK_AUTH).finally(next);
            }
        },
        {
            name: 'chronicles',
            path: '/chronicles',
            component: () => import('@/views/Chronicles')
        },
        {
            name: 'admin',
            path: '/admin',
            component: () => import('@/views/Admin')
        },
        {
            name: 'login',
            path: '/login',
            component: () => import('@/views/Login')
        }
    ]
});
