This commit is contained in:
parent
dee4c49e9d
commit
f6c472f138
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -5,6 +5,7 @@
|
||||
"Chakroun",
|
||||
"commitlint",
|
||||
"dbaeumer",
|
||||
"devcontainer",
|
||||
"devcontainers",
|
||||
"eamodio",
|
||||
"esbenp",
|
||||
|
9
index.ts
9
index.ts
@ -19,7 +19,12 @@ const server = Bun.serve({
|
||||
// 生成上下文
|
||||
const ctx = await genContext(req)
|
||||
// 非健康检查由打印必要信息
|
||||
if (!fullCheck("/health")) {
|
||||
if (
|
||||
exactCheck("/bot") ||
|
||||
exactCheck("/message") ||
|
||||
exactCheck("/sheet") ||
|
||||
startsWithCheck("/micro_app")
|
||||
) {
|
||||
ctx.logger.info(`${req.method} ${req.url}`)
|
||||
ctx.logger.debug(`req body: ${ctx.text}`)
|
||||
}
|
||||
@ -36,7 +41,7 @@ const server = Bun.serve({
|
||||
// 健康检查
|
||||
if (fullCheck("/health")) return ctx.genResp.healthCheck()
|
||||
// 其他
|
||||
return ctx.genResp.ok("hello, there is egg, glade to serve you!")
|
||||
return ctx.genResp.healthCheck("hello, there is egg, glade to serve you!")
|
||||
} catch (error: any) {
|
||||
// 错误处理
|
||||
return ctx.genResp.serverError(error.message || "server error")
|
||||
|
@ -37,7 +37,7 @@
|
||||
"@egg/hooks": "^1.2.0",
|
||||
"@egg/lark-msg-tool": "^1.2.0",
|
||||
"@egg/logger": "^1.3.0",
|
||||
"@egg/net-tool": "^1.5.1",
|
||||
"@egg/net-tool": "^1.6.0",
|
||||
"@egg/path-tool": "^1.3.0",
|
||||
"node-schedule": "^2.1.1",
|
||||
"p-limit": "^6.1.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user