Skip to content

Commit

Permalink
Bump version to 1.4.0 and make baseUrl configurable in IndiePitcher c…
Browse files Browse the repository at this point in the history
…lass constructor
  • Loading branch information
petrpavlik committed Dec 24, 2024
1 parent 667b861 commit d8fd659
Show file tree
Hide file tree
Showing 2 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": "indiepitcher",
"version": "1.3.0",
"version": "1.4.0",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ import type {

export class IndiePitcher {
private readonly headers: Headers;
private readonly baseUrl = 'https://api.indiepitcher.com/v1';
private readonly baseUrl: string;
private readonly userAgent = `indiepitcher-node:${version}`;

constructor(readonly key: string) {
constructor(readonly key: string, baseUrl = "https://api.indiepitcher.com/v1") {
this.key = key;
this.baseUrl = baseUrl;
this.headers = new Headers({
Authorization: `Bearer ${this.key}`,
'User-Agent': this.userAgent,
Expand Down

0 comments on commit d8fd659

Please sign in to comment.