import Vue from 'vue';
import VueRouter from 'vue-router';
import routes from './routes';

Vue.use(VueRouter);

const baseRoutes = [
  {
    path: '*',
    redirect: '/login',
  },
];

routes.push(...baseRoutes);

const router = new VueRouter({
  mode: 'history',
  base: `${window.STATIC_ENV_CONFIG.ROUTER_PREFIX}/`,
  routes: [...routes],
});

export default router;
