File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export class HttpClient {
62
62
setBaseURL ( url : string ) : this {
63
63
this . _urlValidator . validate ( url ) ;
64
64
65
- this . _baseURL = ` ${ url } /api` ;
65
+ this . _baseURL = url ;
66
66
67
67
return this ;
68
68
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import type { StrapiSDKConfig } from './sdk';
12
12
* request dispatch, and response parsing for content management.
13
13
*
14
14
* @param config - The configuration for initializing the SDK. This should include the base URL
15
- * of the Strapi backend instance that the SDK communicates with. The baseURL
15
+ * of the Strapi content API that the SDK communicates with. The baseURL
16
16
* must be formatted with one of the supported protocols: `http` or `https`.
17
17
* Additionally, optional authentication details can be specified within the config.
18
18
*
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ export class StrapiSDK<const T_Config extends StrapiSDKConfig = StrapiSDKConfig>
160
160
* const sdk = createStrapiSDK({ baseURL: 'http://localhost:1337' );
161
161
*
162
162
* // Perform a custom fetch query
163
- * const response = await sdk.fetch('/api/ categories');
163
+ * const response = await sdk.fetch('/categories');
164
164
*
165
165
* // Parse the categories into a readable JSON object
166
166
* const categories = await response.json();
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ describe('HttpClient', () => {
47
47
48
48
// Assert
49
49
expect ( spy ) . toHaveBeenCalledWith ( newBaseURL ) ;
50
- expect ( httpClient . baseURL ) . toBe ( ` ${ newBaseURL } /api` ) ;
50
+ expect ( httpClient . baseURL ) . toBe ( newBaseURL ) ;
51
51
} ) ;
52
52
53
53
it ( 'setAuthStrategy should configure the authentication strategy' , ( ) => {
You can’t perform that action at this time.
0 commit comments