全体像
サーバーとフロントの両方で設定を行う
開発環境では
// if (process.env.NODE_ENV === 'production') {
とコメントアウトする
フロント
modules
nuxt.config.js
modules: [
'@nuxtjs/axios',
// 追加
'@nuxtjs/proxy',
],
axios: {
//追加
proxy: true,
// baseURL: 'http://localhost:3000/display/get-info-commitment'
},
proxy: {
'/display/': {
target: 'http://localhost:3000',
changeOrigin: true,
secure: false
}
},
サーバー