NuxtのaxiosでbaseURLの設定が反映されない原因について
以下の設定だとbaseURLは設定できません。
nuxt.config.js
axios: {
baseUrl: 'http://localhost:3000/api/v1' // 間違い
}
正しくはbaseUrl
ではなくてbaseURL
だからです。以下が正しい設定になります。
nuxt.config.js
axios: {
baseURL: 'http://localhost:3000/api/v1' // 正しい
}
参考になれば幸いです。
終わりに
私は現在、Web3のサービスの開発をしています。詳しくはこちらの記事をご覧下さい。
無料でイーサリアムが当たる、Web3時代の寄付サイトを作った話