From 12f5a9fa83e11fb78c84379fd9177068a9a72514 Mon Sep 17 00:00:00 2001 From: jonHESSO Date: Wed, 27 Mar 2019 13:20:58 +0100 Subject: [PATCH 1/4] changed api urls for deployement with heroku --- src/store.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/store.js b/src/store.js index 54918c6..aa30a27 100644 --- a/src/store.js +++ b/src/store.js @@ -8,7 +8,7 @@ Vue.use(VueAxios, axios) let github_apiURL = 'https://api.github.com' let path = '/repos/ChallengeHunt/challengehunt' -const Backend_API_URL = 'http://127.0.0.1:5000/api' +const Backend_API_URL = 'https://dribdat2.herokuapp.com/api' export default new Vuex.Store({ state: { @@ -71,7 +71,7 @@ export default new Vuex.Store({ }, loadProject({commit}) { axios - .get('http://127.0.0.1:5000/api/project/' + '1' + '/info.json') + .get(`${Backend_API_URL}/project/1/info.json`) .then(r => r.data) .then(project => { commit('SET_PROJECT', project) @@ -79,7 +79,14 @@ export default new Vuex.Store({ }, loadCustomProject({commit}, id) { axios - .get('http://127.0.0.1:5000/api/project/' + id + '/info.json') + .get( `${Backend_API_URL}/project/${id}/info.json`, { + method: 'GET', + mode: 'no-cors', + headers: { + 'Access-Control-Allow-Origin': '*', + 'Content-Type': 'application/json', + } + }) .then(r => r.data) .then(custom_project => { commit('SET_CUSTOM_PROJECT', custom_project) @@ -88,10 +95,10 @@ export default new Vuex.Store({ loadProjectList({commit},event) { let eventId = event || 'current' - var url = `${Backend_API_URL}/event/${eventId}/challenges.json` + var url = `${Backend_API_URL}/event/${eventId}/projects.json` if(eventId === 'current'){ - url = `${Backend_API_URL}/event/current/challenges.json` ; + url = `${Backend_API_URL}/event/current/projects.json` ; } axios @@ -104,7 +111,7 @@ export default new Vuex.Store({ } }) .then(response => { - commit('SET_PROJECT_LIST', response.data.challenges) + commit('SET_PROJECT_LIST', response.data.projects) }) }, setModeEdit({commit}){ From e4f811891b0fc6c8add5292b204e7b6ddcbc7052 Mon Sep 17 00:00:00 2001 From: jonHESSO Date: Wed, 27 Mar 2019 14:27:25 +0100 Subject: [PATCH 2/4] quick https url fix --- src/store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store.js b/src/store.js index aa30a27..657b5d7 100644 --- a/src/store.js +++ b/src/store.js @@ -22,7 +22,7 @@ export default new Vuex.Store({ name: "challengeName" }, id: 1, - pitch: "http://example.com" + pitch: "https://example.com" }, contributors: [], issues: [], From 07c2d4178f336d9aa18fcd35b04490fe6950a756 Mon Sep 17 00:00:00 2001 From: jonHESSO Date: Wed, 27 Mar 2019 15:01:12 +0100 Subject: [PATCH 3/4] added redirect for SPA on netlify --- _redirects | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 _redirects diff --git a/_redirects b/_redirects new file mode 100644 index 0000000..7797f7c --- /dev/null +++ b/_redirects @@ -0,0 +1 @@ +/* /index.html 200 diff --git a/package.json b/package.json index 7bf707f..74b29cd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build", + "build": "vue-cli-service build && mv ./redirects ./dist/_redirects", "lint": "vue-cli-service lint", "test:e2e": "vue-cli-service test:e2e", "test:unit": "vue-cli-service test:unit", From 9466afbd95e426834eb8ca71d87617140eea53f5 Mon Sep 17 00:00:00 2001 From: jonHESSO Date: Wed, 27 Mar 2019 15:03:07 +0100 Subject: [PATCH 4/4] type --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 74b29cd..d7aa01f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build && mv ./redirects ./dist/_redirects", + "build": "vue-cli-service build && mv ./_redirects ./dist/_redirects", "lint": "vue-cli-service lint", "test:e2e": "vue-cli-service test:e2e", "test:unit": "vue-cli-service test:unit",