From b561fde351ad031f4e0e1396aa4683ea0572ab1a Mon Sep 17 00:00:00 2001 From: liuweiqing Date: Sat, 19 Oct 2024 10:48:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A0=E4=B8=8A=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 +-- bypasscf.js | 71 +++++++++++++++++++++++++++++++++++++++----- bypasscf_likeUser.js | 69 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 129 insertions(+), 15 deletions(-) diff --git a/.env b/.env index e1446f25..cd042cf8 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ #支持多账户,使用逗号分隔每个账户,密码中有特殊字符可能会导致识别失败 -USERNAMES=nihao,zaijian -PASSWORDS="123,456" # 密码外面要加上双引号,密码内部如果有双引号,需要加上转义字符,linux使用\转义,Windows使用"转义 (注意GitHub action不需要增加处理,也不需要加引号) +USERNAMES=nihao,zhaijian +PASSWORDS="123,456" # 密码外面要加上双引号,密码内部如果有双引号,需要加上转义字符,linux使用\转义,Windows使用"转义 (注意GitHub action不需要增加处理,也不需要加引号) WEBSITE=https://linux.do # 需要阅读的网站,支持后面那些:https://meta.discourse.org, https://meta.appinn.net, https://community.openai.com #运行时间,单位为分钟 RUN_TIME_LIMIT_MINUTES=20 diff --git a/bypasscf.js b/bypasscf.js index 7aa9fa2c..d3376e28 100644 --- a/bypasscf.js +++ b/bypasscf.js @@ -417,11 +417,11 @@ healthApp.get("/health", (req, res) => { // 将字节转换为MB const memoryUsageMB = { - rss: (memoryUsage.rss / (1024 * 1024)).toFixed(2), // 转换为MB并保留两位小数 - heapTotal: (memoryUsage.heapTotal / (1024 * 1024)).toFixed(2), - heapUsed: (memoryUsage.heapUsed / (1024 * 1024)).toFixed(2), - external: (memoryUsage.external / (1024 * 1024)).toFixed(2), - arrayBuffers: (memoryUsage.arrayBuffers / (1024 * 1024)).toFixed(2), + rss: `${(memoryUsage.rss / (1024 * 1024)).toFixed(2)} MB`, // 转换为MB并保留两位小数 + heapTotal: `${(memoryUsage.heapTotal / (1024 * 1024)).toFixed(2)} MB`, + heapUsed: `${(memoryUsage.heapUsed / (1024 * 1024)).toFixed(2)} MB`, + external: `${(memoryUsage.external / (1024 * 1024)).toFixed(2)} MB`, + arrayBuffers: `${(memoryUsage.arrayBuffers / (1024 * 1024)).toFixed(2)} MB`, }; const healthData = { @@ -433,9 +433,66 @@ healthApp.get("/health", (req, res) => { res.status(200).json(healthData); }); - +healthApp.get("/", (req, res) => { + res.send(` + + + Auto Read + + + +
+

Welcome to the Auto Read App

+

You can check the server's health at /health.

+

GitHub: https://github.com/14790897/auto-read-liunxdo

+
© 2024 Auto Read App
+
+ + + `); +}); healthApp.listen(HEALTH_PORT, () => { console.log( `Health check endpoint is running at http://localhost:${HEALTH_PORT}/health` ); -}); \ No newline at end of file +}); diff --git a/bypasscf_likeUser.js b/bypasscf_likeUser.js index 5014f8fb..5db97d20 100644 --- a/bypasscf_likeUser.js +++ b/bypasscf_likeUser.js @@ -417,11 +417,11 @@ healthApp.get("/health", (req, res) => { // 将字节转换为MB const memoryUsageMB = { - rss: (memoryUsage.rss / (1024 * 1024)).toFixed(2), // 转换为MB并保留两位小数 - heapTotal: (memoryUsage.heapTotal / (1024 * 1024)).toFixed(2), - heapUsed: (memoryUsage.heapUsed / (1024 * 1024)).toFixed(2), - external: (memoryUsage.external / (1024 * 1024)).toFixed(2), - arrayBuffers: (memoryUsage.arrayBuffers / (1024 * 1024)).toFixed(2), + rss: `${(memoryUsage.rss / (1024 * 1024)).toFixed(2)} MB`, // 转换为MB并保留两位小数 + heapTotal: `${(memoryUsage.heapTotal / (1024 * 1024)).toFixed(2)} MB`, + heapUsed: `${(memoryUsage.heapUsed / (1024 * 1024)).toFixed(2)} MB`, + external: `${(memoryUsage.external / (1024 * 1024)).toFixed(2)} MB`, + arrayBuffers: `${(memoryUsage.arrayBuffers / (1024 * 1024)).toFixed(2)} MB`, }; const healthData = { @@ -433,7 +433,64 @@ healthApp.get("/health", (req, res) => { res.status(200).json(healthData); }); - +healthApp.get("/", (req, res) => { + res.send(` + + + Auto Read + + + +
+

Welcome to the Auto Read App

+

You can check the server's health at /health.

+

GitHub: https://github.com/14790897/auto-read-liunxdo

+ +
+ + + `); +}); healthApp.listen(HEALTH_PORT, () => { console.log( `Health check endpoint is running at http://localhost:${HEALTH_PORT}/health`