Skip to content

Instantly share code, notes, and snippets.

@Maxim-Kolmogorov
Last active November 6, 2022 10:45
Show Gist options
  • Save Maxim-Kolmogorov/52085e19c773e38e61674ae4b86a685b to your computer and use it in GitHub Desktop.
Save Maxim-Kolmogorov/52085e19c773e38e61674ae4b86a685b to your computer and use it in GitHub Desktop.
Laravel 9 + Vite + Vue.js + SSR = example, part 8
import { createWebHistory, createMemoryHistory, createRouter } from 'vue-router';
const isServer = typeof window === 'undefined';
const history = isServer ? createMemoryHistory() : createWebHistory();
import Home from './pages/Home.vue';
import About from './pages/About.vue';
const routes = [
{ path: '/', name: 'home', component: Home },
{ path: '/about', name: 'about', component: About },
];
const router = createRouter({
history,
routes,
});
export default router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment