From ef11f2aa3ab40dbf87eee6dd58b853ee88349287 Mon Sep 17 00:00:00 2001 From: zhilv Date: Thu, 18 Dec 2025 18:40:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=AE=9E=E9=AA=8C=20?= =?UTF-8?q?7=20=E7=9A=84=E7=AC=AC=202=20=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/tests/test7/{ => 7.1}/index.js | 0 Server/tests/test7/{ => 7.1}/index2.js | 0 Server/tests/test7/{ => 7.1}/index3.js | 0 Server/tests/test7/{ => 7.1}/index4.js | 0 Server/tests/test7/{ => 7.1}/package.json | 2 +- Server/tests/test7/{ => 7.2}/.gitignore | 0 Server/tests/test7/7.2/index.js | 30 +++++++++++++++++++++++ Server/tests/test7/7.2/package.json | 17 +++++++++++++ 8 files changed, 48 insertions(+), 1 deletion(-) rename Server/tests/test7/{ => 7.1}/index.js (100%) rename Server/tests/test7/{ => 7.1}/index2.js (100%) rename Server/tests/test7/{ => 7.1}/index3.js (100%) rename Server/tests/test7/{ => 7.1}/index4.js (100%) rename Server/tests/test7/{ => 7.1}/package.json (92%) rename Server/tests/test7/{ => 7.2}/.gitignore (100%) create mode 100644 Server/tests/test7/7.2/index.js create mode 100644 Server/tests/test7/7.2/package.json diff --git a/Server/tests/test7/index.js b/Server/tests/test7/7.1/index.js similarity index 100% rename from Server/tests/test7/index.js rename to Server/tests/test7/7.1/index.js diff --git a/Server/tests/test7/index2.js b/Server/tests/test7/7.1/index2.js similarity index 100% rename from Server/tests/test7/index2.js rename to Server/tests/test7/7.1/index2.js diff --git a/Server/tests/test7/index3.js b/Server/tests/test7/7.1/index3.js similarity index 100% rename from Server/tests/test7/index3.js rename to Server/tests/test7/7.1/index3.js diff --git a/Server/tests/test7/index4.js b/Server/tests/test7/7.1/index4.js similarity index 100% rename from Server/tests/test7/index4.js rename to Server/tests/test7/7.1/index4.js diff --git a/Server/tests/test7/package.json b/Server/tests/test7/7.1/package.json similarity index 92% rename from Server/tests/test7/package.json rename to Server/tests/test7/7.1/package.json index 8da8de5..0c0e2c6 100644 --- a/Server/tests/test7/package.json +++ b/Server/tests/test7/7.1/package.json @@ -1,5 +1,5 @@ { - "name": "test7", + "name": "7.1", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/Server/tests/test7/.gitignore b/Server/tests/test7/7.2/.gitignore similarity index 100% rename from Server/tests/test7/.gitignore rename to Server/tests/test7/7.2/.gitignore diff --git a/Server/tests/test7/7.2/index.js b/Server/tests/test7/7.2/index.js new file mode 100644 index 0000000..045d81f --- /dev/null +++ b/Server/tests/test7/7.2/index.js @@ -0,0 +1,30 @@ +const Koa = require("koa"); +const Router = require("@koa/router"); + +const app = new Koa(); +const router = new Router(); + +app.use(async (ctx, next) => { + ctx.set("Content-type", "application/json") + await next(); +}) + +router.get("/", async (ctx) => { + ctx.body = "Welcome to theKoaServer!"; +}) + +router.get("/about", async (ctx) => { + ctx.body = "This is the about page."; +}) + +router.get("/contact", (ctx) => { + ctx.body = "This is the contact page." +}) + +app.use(router.routes()).use(router.allowedMethods()); + +const port = 3000; + +app.listen(port, () => { + console.log(`Server is running on http://localhost:${port}`); +}) \ No newline at end of file diff --git a/Server/tests/test7/7.2/package.json b/Server/tests/test7/7.2/package.json new file mode 100644 index 0000000..97f32d6 --- /dev/null +++ b/Server/tests/test7/7.2/package.json @@ -0,0 +1,17 @@ +{ + "name": "7.2", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "packageManager": "pnpm@10.14.0", + "dependencies": { + "@koa/router": "^15.1.0", + "koa": "^3.1.1" + } +}