Skip to content

Commit ec4cc4b

Browse files
James TsaiJames Tsai
authored andcommitted
refactor: set end point URL's default value
1 parent 226a9a7 commit ec4cc4b

2 files changed

Lines changed: 150 additions & 3 deletions

File tree

nodejs/package-lock.json

Lines changed: 148 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as HackMDErrors from './error'
55
export class API {
66
private axios: AxiosInstance
77

8-
constructor(public hackmdAPIEndpointURL:string, readonly accessToken: string) {
8+
constructor(readonly accessToken: string, public hackmdAPIEndpointURL: string = "https://api.hackmd.io/v1") {
99
if (!accessToken) {
1010
throw new HackMDErrors.MissingRequiredArgument('Missing access token when creating HackMD client')
1111
}
@@ -112,4 +112,4 @@ export class API {
112112
const { data } = await this.axios.delete<void>(`teams/${teamPath}/notes/${noteId}`)
113113
return data
114114
}
115-
}
115+
}

0 commit comments

Comments
 (0)