File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export type OpenAPIConfig = {
39
39
} ;
40
40
} ;
41
41
42
- export const COMPOSIO_BASE_URL = "https://backend.composio.dev/ " ;
42
+ export const COMPOSIO_BASE_URL = "https://backend.composio.dev" ;
43
43
44
44
export const OpenAPI : OpenAPIConfig = {
45
45
BASE : COMPOSIO_BASE_URL ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { client as axiosClient } from "../client/services.gen";
4
4
import { setAxiosClientConfig } from "../utils/config" ;
5
5
import { CEG } from "../utils/error" ;
6
6
import { COMPOSIO_SDK_ERROR_CODES } from "../utils/errors/src/constants" ;
7
+ import { removeTrailingSlashIfExists } from "../utils/string" ;
7
8
8
9
/**
9
10
* Class representing the details required to initialize and configure the API client.
@@ -35,7 +36,7 @@ export class BackendClient {
35
36
constructor ( apiKey : string , baseUrl : string , runtime ?: string ) {
36
37
this . runtime = runtime || "" ;
37
38
this . apiKey = apiKey ;
38
- this . baseUrl = baseUrl ;
39
+ this . baseUrl = removeTrailingSlashIfExists ( baseUrl ) ;
39
40
this . instance = axiosClient . instance ;
40
41
41
42
if ( ! apiKey ) {
@@ -84,7 +85,7 @@ export class BackendClient {
84
85
*/
85
86
private initializeApiClient ( ) {
86
87
axiosClient . setConfig ( {
87
- baseURL : this . baseUrl ,
88
+ baseURL : removeTrailingSlashIfExists ( this . baseUrl ) ,
88
89
headers : {
89
90
"X-API-KEY" : `${ this . apiKey } ` ,
90
91
"X-SOURCE" : "js_sdk" ,
Original file line number Diff line number Diff line change
1
+ export const removeTrailingSlashIfExists = ( str : string ) => str . replace ( / \/ + $ / , '' ) ;
You can’t perform that action at this time.
0 commit comments