diff --git a/.env.example b/.env.example index 75ea288..55a6d73 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,3 @@ VUE_APP_TITLE=kamilcraft.com -BASE_URL=http://127.0.0.1 +VUE_APP_BASE_URL=http://127.0.0.1 +VUE_APP_API_URL=https://api.kamilcraft.com diff --git a/public/index.html b/public/index.html index 5efb38e..66dc21e 100644 --- a/public/index.html +++ b/public/index.html @@ -6,7 +6,7 @@ - + KamilCraft.com diff --git a/src/components/Navigation.vue b/src/components/Navigation.vue index b09537a..fb25a62 100644 --- a/src/components/Navigation.vue +++ b/src/components/Navigation.vue @@ -172,7 +172,7 @@ export default { } ], clicked: false, - publicPath: process.env.BASE_URL + publicPath: process.env.VUE_APP_BASE_URL + '/' } }, computed: { diff --git a/src/components/sections/About.vue b/src/components/sections/About.vue index 7966789..63a74fc 100644 --- a/src/components/sections/About.vue +++ b/src/components/sections/About.vue @@ -128,7 +128,7 @@ import BaseButton from '../BaseButton' export default { data () { return { - publicPath: process.env.BASE_URL + publicPath: process.env.VUE_APP_BASE_URL + '/' } }, methods: { diff --git a/src/components/sections/FavoriteProjects.vue b/src/components/sections/FavoriteProjects.vue index d9d4256..d3cdc84 100644 --- a/src/components/sections/FavoriteProjects.vue +++ b/src/components/sections/FavoriteProjects.vue @@ -22,7 +22,7 @@ export default { name: 'FavoriteProjects', data () { return { - publicPath: process.env.BASE_URL, + publicPath: process.env.VUE_APP_BASE_URL + '/', select_projects: [] } }, @@ -31,7 +31,7 @@ export default { }, methods: { loadProjectList () { - fetch('https://api.kamilcraft.com/projects/category/selected') + fetch(process.env.VUE_APP_API_URL + '/projects/category/selected') .then(response => response.json()) .then(data => { this.select_projects = data diff --git a/src/router/index.js b/src/router/index.js index bffd044..298bcc3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -64,13 +64,16 @@ const routes = [ { path: '*', name: '404', + meta: { + title: 'Błąd 404' + }, component: NotFound } ] const router = new VueRouter({ mode: 'history', - base: process.env.BASE_URL ?? '/', + base: '/', routes, scrollBehavior (to, from, savedPosition) { if (savedPosition) { diff --git a/src/store/index.js b/src/store/index.js index 75c0578..998be25 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -25,7 +25,7 @@ const moduleSettings = { }, actions: { fetchProjects (store) { - return fetch('https://api.kamilcraft.com/projects') + return fetch(process.env.VUE_APP_API_URL + '/projects') .then(response => response.json()) .then(data => { store.commit('setProjects', data) @@ -33,7 +33,7 @@ const moduleSettings = { }) }, fetchCategories (store) { - return fetch('https://api.kamilcraft.com/categories') + return fetch(process.env.VUE_APP_API_URL + '/categories') .then(response => response.json()) .then(data => { store.commit('setCategories', data) diff --git a/src/views/About.vue b/src/views/About.vue index 4f06b13..f924c37 100644 --- a/src/views/About.vue +++ b/src/views/About.vue @@ -63,7 +63,7 @@ export default { name: 'About', data () { return { - publicPath: process.env.BASE_URL + publicPath: process.env.VUE_APP_BASE_URL + '/' } }, mounted () { diff --git a/src/views/Home.vue b/src/views/Home.vue index 9b7b857..98c7d5b 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -15,7 +15,7 @@ export default { name: 'Home', data () { return { - publicPath: process.env.BASE_URL, + publicPath: process.env.VUE_APP_BASE_URL + '/', select_projects: [] } }, diff --git a/src/views/Projects.vue b/src/views/Projects.vue index ec135db..b490e55 100644 --- a/src/views/Projects.vue +++ b/src/views/Projects.vue @@ -102,7 +102,7 @@ export default { categories: { active: 'all' }, - publicPath: process.env.BASE_URL, + publicPath: process.env.VUE_APP_BASE_URL + '/', projects: [] } },