Variables for the API have been updated

This commit is contained in:
Kamil Niemczycki 2022-02-16 13:21:35 +01:00
parent 04ad8334ba
commit 519bad5689
10 changed files with 16 additions and 12 deletions

View File

@ -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

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="icon" href="<%= VUE_APP_BASE_URL %>/favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Thasadith&display=swap" rel="stylesheet">
<title>KamilCraft.com</title>

View File

@ -172,7 +172,7 @@ export default {
}
],
clicked: false,
publicPath: process.env.BASE_URL
publicPath: process.env.VUE_APP_BASE_URL + '/'
}
},
computed: {

View File

@ -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: {

View File

@ -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

View File

@ -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) {

View File

@ -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)

View File

@ -63,7 +63,7 @@ export default {
name: 'About',
data () {
return {
publicPath: process.env.BASE_URL
publicPath: process.env.VUE_APP_BASE_URL + '/'
}
},
mounted () {

View File

@ -15,7 +15,7 @@ export default {
name: 'Home',
data () {
return {
publicPath: process.env.BASE_URL,
publicPath: process.env.VUE_APP_BASE_URL + '/',
select_projects: []
}
},

View File

@ -102,7 +102,7 @@ export default {
categories: {
active: 'all'
},
publicPath: process.env.BASE_URL,
publicPath: process.env.VUE_APP_BASE_URL + '/',
projects: []
}
},