Skip to content

Commit

Permalink
Support custom API endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
stooit committed Dec 11, 2024
1 parent 48e944a commit 3144f89
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quantcdn/quant-client",
"version": "2.0.5",
"version": "2.0.6",
"description": "Client library for API connectivity",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ export class QuantClient {
Client = HttpClient
}

this._project = new Client('https://api.quantcdn.io/v1', {
this._project = new Client(config.endpoint ?? 'https://api.quantcdn.io/v1', {
'User-Agent': 'Quant (+http://api.quantcdn.io)',
'Quant-Token': config.token,
'Quant-Customer': config.organization,
'Quant-Project': config.project,
'Content-Type': 'application/json'
})
this._search = new Client('https://api.quantcdn.io/v1', {
this._search = new Client(config.endpoint ?? 'https://api.quantcdn.io/v1', {
'User-Agent': 'Quant (+http://api.quantcdn.io)',
'Quant-Token': config.token,
'Quant-Customer': config.organization,
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface Config {
token?: string
project?: string
bearer?: string
endpoint?: string
}

export interface ProxyPayload {
Expand Down

0 comments on commit 3144f89

Please sign in to comment.