Skip to content

Commit

Permalink
renamed baseUrl to host for better understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
zAlweNy26 committed Oct 4, 2024
1 parent d26b730 commit df6a9e9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-apricots-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ccat-api": patch
---

renamed `baseUrl` to `host` for better understanding.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ To set up the client, you must first import the `CatClient` class:
import { CatClient } from 'ccat-api'

const cat = new CatClient({
baseUrl: 'localhost',
host: 'localhost',
userId: 'user',
//... other settings
})
Expand All @@ -60,7 +60,7 @@ cat.send('Hello from a new user!') // this will send a message to the /ws/new_us

| **Property** | **Type** | **Default** | **Description** |
|:--------------:|:--------:|:------------:|:--------------------------------------------------------------------------------:|
| **baseUrl** | string | **Required** | The same of **CCAT_CORE_HOST** |
| **host** | string | **Required** | The same of **CCAT_CORE_HOST** |
| **credential** | string | undefined | The same of **CCAT_API_KEY** or the JWT token |
| **port** | number | 1865 | The same of the **CCAT_CORE_PORT** |
| **secure** | boolean | false | The same of the **CCAT_CORE_USE_SECURE_PROTOCOLS** |
Expand Down
2 changes: 1 addition & 1 deletion api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class CatClient {

private get url() {
return `http${this.config.secure ? 's' : ''}://
${this.config.baseUrl}
${this.config.host}
${this.config.port ? `:${this.config.port}` : ''}
`.replace(/\s/g, '')
}
Expand Down
4 changes: 2 additions & 2 deletions api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export interface WebSocketSettings {
}

export interface CatSettings {
/** The URL to which connect to the Cat
/** The hostname to which connect to the Cat
* @example 'localhost'
*/
baseUrl: string
host: string
/**
* The token or key to authenticate the Cat endpoints
* @default undefined
Expand Down

0 comments on commit df6a9e9

Please sign in to comment.