File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -17,13 +17,23 @@ export default abstract class extends Command {
1717 this . configuration = explorerSync . search ( )
1818 this . apiKey = this . configuration ?. config . apiKey
1919
20- // Configure API.
20+ // Configure API calls .
2121 axios . defaults . baseURL =
22- this . configuration ?. config . baseURL ||
23- 'https://voxable.design/api/v1/'
24- axios . defaults . headers . common = {
25- Authorization : `Bearer ${ this . apiKey } ` ,
26- 'User-Agent' : '@voxable/cli' ,
22+ this . configuration ?. config . baseURL || 'https://api.voxable.design/v1/'
23+ axios . defaults . headers . common . Authorization = `Bearer ${ this . apiKey } `
24+ axios . defaults . headers . common [ 'User-Agent' ] = '@voxable/cli'
25+
26+ // Debug requests and responses if DEBUG=true
27+ if ( process . env . DEBUG ) {
28+ axios . interceptors . request . use ( req => {
29+ console . log ( req )
30+ return req
31+ } , error => Promise . reject ( error ) )
32+
33+ axios . interceptors . response . use ( res => {
34+ console . log ( res )
35+ return res
36+ } , error => Promise . reject ( error ) )
2737 }
2838
2939 this . fetch = axios
You can’t perform that action at this time.
0 commit comments