useshortcut / shortcut-client-js

The official JavaScript client library for the Shortcut (formerly Clubhouse) REST API.
https://useshortcut.github.io/shortcut-client-js/
132 stars 31 forks source link

Error: Error: Response for preflight has invalid HTTP status code 401(Solved) #140

Open hiaux0 opened 2 years ago

hiaux0 commented 2 years ago

Nodejs v14.19.1 Typescript v4.7.4 Quokkajs

Steps

I just wanted to open an issue, and also post the solution I found. This was the comment, that pointed me to the solution https://github.com/axios/axios/issues/2061#issuecomment-596174699

const shortcut = new ShortcutClient(SHORTCUT_API_TOKEN, {
  adapter: require('axios/lib/adapters/http'),     // <- add this
});