I can communicate from local (Nuxt) to heroku (rails) without any problems, but
When I try to access heroku(rails) from heroku(Nuxt) with axios, I get 404 error.
I think there is no problem with setting the cors on the rails side.
I could see that it is 404 in the Heroku log on the Nxt side.
I have also confirmed that the request has not arrived in the rails log.
When I got it with the API test tool, it came off normally, so I think it's Nxt's setting.
I will write the proxy settings below.
proxy:{
'/rails': {
target: 'https://myapp.herokuapp.com',
pathRewrite: {
US>'^/rails': '/'
}
}
},
If you know anything, please let me know.
ruby-on-rails heroku nuxt.js axios
I solved myself.
axios:{
baseURL: 'https://myapp.herokuapp.com'
},
When I removed the proxy as , the request was successfully passed.
What happens to CORS without proxy?
I have some questions left, but I am writing to let you know that it has been resolved.
© 2024 OneMinuteCode. All rights reserved.