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" + } +}