4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Nuxt.jsビギナーズガイドで「Request failed with status code 401」にハマった

Posted at

スクリーンショット 2020-11-21 15.40.56.png

Nuxt.jsビギナーズガイド第二章にて上記エラーに2時間ほどハマったので。

##正誤表がありました。
正誤表

本書では、第二章で Qiita API へとアクセスを行いますが、その際のトークン指定方法に誤りがあったため、以下のように設定するようにお願いたします。

正: config.headers.common['Authorization'] =`Bearer ${process.env.QIITA_TOKEN}`
誤: config.headers.common['Authorization'] = process.env.QIITA_TOKEN


他にも何かと誤植があるので要チェックですね。

4
0
0

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
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?