File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,17 @@ module.exports = {
6666 ** Axios configuration
6767 */
6868 axios : {
69- baseURL : process . env . API_URL
69+ proxy : true
70+ } ,
71+
72+ /*
73+ ** Proxy configuration
74+ */
75+ proxy : {
76+ '/api/' : {
77+ target : process . env . API_URL ,
78+ pathRewrite : { '^/api/' : '' }
79+ }
7080 } ,
7181
7282 /*
Original file line number Diff line number Diff line change 2121 "dependencies" : {
2222 "@nuxtjs/axios" : " ^5.9.5" ,
2323 "@nuxtjs/google-gtag" : " ^1.0.4" ,
24+ "@nuxtjs/proxy" : " ^1.3.3" ,
2425 "@nuxtjs/pwa" : " ^3.0.0-beta.20" ,
2526 "animated-number-vue" : " ^1.0.0" ,
2627 "apexcharts" : " ^3.17.0" ,
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ export default {
22 async nuxtServerInit ( { commit } , ctx ) {
33 await Promise
44 . all ( [
5- this . $axios . get ( process . env . NODE_ENV !== 'production' ? 'latest.json' : '/latest' ) ,
6- this . $axios . get ( process . env . NODE_ENV !== 'production' ? 'locations.json' : '/locations' )
5+ this . $axios . get ( process . env . NODE_ENV !== 'production' ? 'latest.json' : '/api/ latest' ) ,
6+ this . $axios . get ( process . env . NODE_ENV !== 'production' ? 'locations.json' : '/api/ locations' )
77 ] )
88 . then ( res => {
99 commit ( 'SET_LATEST' , res [ 0 ] . data . latest )
@@ -17,7 +17,7 @@ export default {
1717 async getOverviewByCountry ( { commit } , id ) {
1818 await this . $axios
1919 . get (
20- process . env . NODE_ENV !== 'production' ? 'location-16.json' : `/locations/${ id } `
20+ process . env . NODE_ENV !== 'production' ? 'location-16.json' : `/api/ locations/${ id } `
2121 )
2222 . then ( res => {
2323 if ( res . status === 200 ) {
You can’t perform that action at this time.
0 commit comments