mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
18 lines
467 B
TypeScript
18 lines
467 B
TypeScript
/**
|
|
* Internal API Server endpoint — Preload API
|
|
*
|
|
* Exposes the Internal Server's baseUrl and ephemeral token to the Renderer.
|
|
* Token is held in memory only (never persisted to localStorage/sessionStorage).
|
|
*/
|
|
|
|
import { ipcRenderer } from 'electron'
|
|
|
|
export interface InternalEndpoint {
|
|
baseUrl: string
|
|
token: string
|
|
}
|
|
|
|
export const internalApi = {
|
|
getEndpoint: (): Promise<InternalEndpoint | null> => ipcRenderer.invoke('internal-api:getEndpoint'),
|
|
}
|