LoginSignup
8
5

More than 3 years have passed since last update.

axios.getをproxy経由で行う

Last updated at Posted at 2019-07-02

Proxy環境下でFirebaseからaxios経由でデータ取得時にハマったのでメモ
色々試しましたが、これが効いてるようです。

環境

・Ubuntu 16.04
・Nuxt.js v2.8.1
・axios

実装

const url = "xxxxxxxxx"
const config = { proxy: { host: proxy.ip, port: proxy.port } }

axios.get(url, config)
.then(result => {})
.catch(error => {console.log(error)})

https://github.com/axios/axios#request-config の下のほうに書いてある。

8
5
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
5