Help us understand the problem. What is going on with this article?

axios.getをproxy経由で行う

More than 1 year has passed since last update.

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 の下のほうに書いてある。

kurousa
雑食系エンジニア
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした