diff --git a/src/components/ErrorPage.vue b/src/components/ErrorPage.vue new file mode 100644 index 00000000..2fdf4603 --- /dev/null +++ b/src/components/ErrorPage.vue @@ -0,0 +1,68 @@ + + + + + + + + 404 + + + + + Look like you're lost + + + The page you are looking for is not available! + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index 26f4d038..90f1f94a 100644 --- a/src/main.js +++ b/src/main.js @@ -7,11 +7,14 @@ import VueVocabulary from '@creativecommons/vocabulary-components'; // Analytics import * as Sentry from '@sentry/vue'; +// Router setup +import router from './router'; // Import the router configuration + Vue.config.productionTip = false; + Vue.use(VueVocabulary); Vue.use(VueScrollTo); - Sentry.init({ dsn: process.env.NODE_ENV === 'production' @@ -20,12 +23,11 @@ Sentry.init({ logErrors: process.env.NODE_ENV !== 'production', // Only log errors in dev env }); - -if(process.env.VUE_APP_CC_OUTPUT!=='embedded') { +if (process.env.VUE_APP_CC_OUTPUT !== 'embedded') { new Vue({ render: h => h(App), + router, // Add the router to the Vue instance }).$mount('#app'); } export default App; - diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 00000000..cc5f47ed --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,17 @@ +import Vue from 'vue'; +import Router from 'vue-router'; +import ErrorPage from '../components/ErrorPage.vue'; + +Vue.use(Router); + +const router = new Router({ + routes: [ + { + path: '*', // Wildcard route for any unmatched routes + name: 'error', + component: ErrorPage // Show the ErrorPage component for 404 + } + ] +}); + +export default router;
The page you are looking for is not available!