Study Note

Study Note

Jack

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

Test JavaScript in Hexo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { proxyToUpstream, type Env } from "./core";

function extractEnv(arg2: unknown, arg3: unknown): Env {
const isExecutionCtx = (obj: unknown): boolean =>
!!obj &&
(typeof (obj as { waitUntil?: unknown }).waitUntil === "function" ||
typeof (obj as { passThroughOnException?: unknown }).passThroughOnException ===
"function");
if (isExecutionCtx(arg3)) return (arg2 ?? {}) as Env; // Cloudflare: env 2nd
return (arg3 ?? arg2 ?? {}) as Env; // ESA: env 3rd; legacy EdgeOne: 2nd
}

export default {
async fetch(request: Request, arg2?: unknown, arg3?: unknown): Promise<Response> {
const env = extractEnv(arg2, arg3);
const upstream =
env.EDGE_UPSTREAM || "http://127.0.0.1:8080"; // placeholder for local smoke test
try {
return await proxyToUpstream(request, upstream);
} catch (err) {
console.error("[edge] unhandled error:", err);
return new Response(
JSON.stringify({ code: 500, message: "Internal Server Error" }),
{ status: 500, headers: { "content-type": "application/json" } }
);
}
},
};

test mermaid diagram

flowchart TB
    subgraph Client["前端 - Vue 3 + LiteGraph"]
        UI["Web UI
工作流编辑器"] WSClient["WebSocket Client"] HTTPClient["HTTP Client"] end subgraph Server["后端 - Python"] HTTPServer["HTTP Server
aiohttp"] WSServer["WebSocket Server"] PromptServer["Prompt Server
接收工作流"] ExecutionEngine["执行引擎
PromptExecutor"] NodeRegistry["节点注册表
NODE_CLASS_MAPPINGS"] CacheSystem["缓存系统
Cache ID"] QueueManager["队列管理器
Queue Manager"] GPU["GPU 推理"] end UI --> HTTPClient UI --> WSClient HTTPClient -->|POST /prompt| HTTPServer WSClient <-->|状态推送| WSServer HTTPServer --> PromptServer PromptServer --> QueueManager QueueManager --> ExecutionEngine ExecutionEngine --> NodeRegistry ExecutionEngine --> CacheSystem ExecutionEngine --> GPU ExecutionEngine -->|status/executing| WSServer

More info: Deployment

  • Title: Study Note
  • Author: Jack
  • Created at : 2026-08-26 11:08:11
  • Updated at : 2026-08-30 00:21:07
  • Link: https://your-domain.com/study/
  • License: This work is licensed under CC BY-NC-SA 4.0.