mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat: telegram platform
This commit is contained in:
Binary file not shown.
@@ -4,7 +4,12 @@ import { treaty } from '@elysiajs/eden'
|
||||
export type ApiClient = typeof app
|
||||
|
||||
export const createClient = (
|
||||
baseUrl: string = process.env.API_BASE_URL ?? 'http://localhost:7002'
|
||||
baseUrl: string = process.env.API_BASE_URL ?? 'http://localhost:7002',
|
||||
token?: string,
|
||||
) => {
|
||||
return treaty<ApiClient>(baseUrl)
|
||||
return treaty<ApiClient>(baseUrl, {
|
||||
headers: token ? {
|
||||
'Authorization': `Bearer ${token}`,
|
||||
} : undefined,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user