MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / routeRequest

Method routeRequest

src/main/core/httpServer.ts:202–213  ·  view source on GitHub ↗
(url: string, body: Record<string, unknown>)

Source from the content-addressed store, hash-verified

200 }
201
202 private async routeRequest(url: string, body: Record<string, unknown>): Promise<ApiResponse> {
203 switch (url) {
204 case '/api/window/show':
205 return this.handleShowWindow(body)
206 case '/api/window/hide':
207 return this.handleHideWindow()
208 case '/api/window/toggle':
209 return this.handleToggleWindow()
210 default:
211 return { code: 404, message: `未知接口: ${url}` }
212 }
213 }
214
215 private handleShowWindow(body: Record<string, unknown>): ApiResponse {
216 try {

Callers 1

handleRequestMethod · 0.95

Calls 3

handleShowWindowMethod · 0.95
handleHideWindowMethod · 0.95
handleToggleWindowMethod · 0.95

Tested by

no test coverage detected