v0.10.5 首页 H2 产品线入口 ×6:ImageBoxWidget 重构为 Elementor 忠实 DOM + slim 白名单补齐 + H2 scoped CSS(post-18 对齐,桌面/移动/hover 实测一致)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* # 文件 Start 入口(src/start.ts)
|
||||
* 注册全局 request middleware:CSRF 保护(server fn RPC)+ 旧链接重定向。
|
||||
* 该文件由 TanStack Start 插件按约定扫描(默认 entry 名 start)。
|
||||
*/
|
||||
import { createStart, createCsrfMiddleware } from "@tanstack/react-start";
|
||||
import { redirectMiddleware } from "./server/middleware";
|
||||
import { initDb } from "./db";
|
||||
|
||||
// 服务端启动即初始化数据库连接池(惰性 db 的预热;客户端包不含此逻辑)
|
||||
await initDb();
|
||||
|
||||
/** # 成员变量 CSRF 中间件(仅作用于 serverFn RPC 请求) **/
|
||||
const csrfMiddleware = createCsrfMiddleware({
|
||||
filter: (ctx) => ctx.handlerType === "serverFn",
|
||||
});
|
||||
|
||||
/** # 成员变量 Start 实例(全局中间件链) **/
|
||||
export const startInstance = createStart(() => ({
|
||||
requestMiddleware: [csrfMiddleware, redirectMiddleware],
|
||||
}));
|
||||
Reference in New Issue
Block a user