Variables for the API have been updated
This commit is contained in:
		| @@ -1,2 +1,3 @@ | |||||||
| VUE_APP_TITLE=kamilcraft.com | 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 | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ | |||||||
|     <meta name="viewport" content="width=device-width,initial-scale=1.0"> |     <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.googleapis.com"> | ||||||
|     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |     <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=Roboto:wght@100;400;700&display=swap" rel="stylesheet"> | ||||||
|     <link href="https://fonts.googleapis.com/css2?family=Thasadith&display=swap" rel="stylesheet"> |     <link href="https://fonts.googleapis.com/css2?family=Thasadith&display=swap" rel="stylesheet"> | ||||||
|     <title>KamilCraft.com</title> |     <title>KamilCraft.com</title> | ||||||
|   | |||||||
| @@ -172,7 +172,7 @@ export default { | |||||||
|         } |         } | ||||||
|       ], |       ], | ||||||
|       clicked: false, |       clicked: false, | ||||||
|       publicPath: process.env.BASE_URL |       publicPath: process.env.VUE_APP_BASE_URL + '/' | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   computed: { |   computed: { | ||||||
|   | |||||||
| @@ -128,7 +128,7 @@ import BaseButton from '../BaseButton' | |||||||
| export default { | export default { | ||||||
|   data () { |   data () { | ||||||
|     return { |     return { | ||||||
|       publicPath: process.env.BASE_URL |       publicPath: process.env.VUE_APP_BASE_URL + '/' | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ export default { | |||||||
|   name: 'FavoriteProjects', |   name: 'FavoriteProjects', | ||||||
|   data () { |   data () { | ||||||
|     return { |     return { | ||||||
|       publicPath: process.env.BASE_URL, |       publicPath: process.env.VUE_APP_BASE_URL + '/', | ||||||
|       select_projects: [] |       select_projects: [] | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
| @@ -31,7 +31,7 @@ export default { | |||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     loadProjectList () { |     loadProjectList () { | ||||||
|       fetch('https://api.kamilcraft.com/projects/category/selected') |       fetch(process.env.VUE_APP_API_URL + '/projects/category/selected') | ||||||
|         .then(response => response.json()) |         .then(response => response.json()) | ||||||
|         .then(data => { |         .then(data => { | ||||||
|           this.select_projects = data |           this.select_projects = data | ||||||
|   | |||||||
| @@ -64,13 +64,16 @@ const routes = [ | |||||||
|   { |   { | ||||||
|     path: '*', |     path: '*', | ||||||
|     name: '404', |     name: '404', | ||||||
|  |     meta: { | ||||||
|  |       title: 'Błąd 404' | ||||||
|  |     }, | ||||||
|     component: NotFound |     component: NotFound | ||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const router = new VueRouter({ | const router = new VueRouter({ | ||||||
|   mode: 'history', |   mode: 'history', | ||||||
|   base: process.env.BASE_URL ?? '/', |   base: '/', | ||||||
|   routes, |   routes, | ||||||
|   scrollBehavior (to, from, savedPosition) { |   scrollBehavior (to, from, savedPosition) { | ||||||
|     if (savedPosition) { |     if (savedPosition) { | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ const moduleSettings = { | |||||||
|   }, |   }, | ||||||
|   actions: { |   actions: { | ||||||
|     fetchProjects (store) { |     fetchProjects (store) { | ||||||
|       return fetch('https://api.kamilcraft.com/projects') |       return fetch(process.env.VUE_APP_API_URL + '/projects') | ||||||
|         .then(response => response.json()) |         .then(response => response.json()) | ||||||
|         .then(data => { |         .then(data => { | ||||||
|           store.commit('setProjects', data) |           store.commit('setProjects', data) | ||||||
| @@ -33,7 +33,7 @@ const moduleSettings = { | |||||||
|         }) |         }) | ||||||
|     }, |     }, | ||||||
|     fetchCategories (store) { |     fetchCategories (store) { | ||||||
|       return fetch('https://api.kamilcraft.com/categories') |       return fetch(process.env.VUE_APP_API_URL + '/categories') | ||||||
|         .then(response => response.json()) |         .then(response => response.json()) | ||||||
|         .then(data => { |         .then(data => { | ||||||
|           store.commit('setCategories', data) |           store.commit('setCategories', data) | ||||||
|   | |||||||
| @@ -63,7 +63,7 @@ export default { | |||||||
|   name: 'About', |   name: 'About', | ||||||
|   data () { |   data () { | ||||||
|     return { |     return { | ||||||
|       publicPath: process.env.BASE_URL |       publicPath: process.env.VUE_APP_BASE_URL + '/' | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   mounted () { |   mounted () { | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ export default { | |||||||
|   name: 'Home', |   name: 'Home', | ||||||
|   data () { |   data () { | ||||||
|     return { |     return { | ||||||
|       publicPath: process.env.BASE_URL, |       publicPath: process.env.VUE_APP_BASE_URL + '/', | ||||||
|       select_projects: [] |       select_projects: [] | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   | |||||||
| @@ -102,7 +102,7 @@ export default { | |||||||
|       categories: { |       categories: { | ||||||
|         active: 'all' |         active: 'all' | ||||||
|       }, |       }, | ||||||
|       publicPath: process.env.BASE_URL, |       publicPath: process.env.VUE_APP_BASE_URL + '/', | ||||||
|       projects: [] |       projects: [] | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user