diff --git a/package.json b/package.json index f460dd7..e69800c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package", "name": "@kevisual/router", - "version": "0.0.21", + "version": "0.0.22", "description": "", "type": "module", "main": "./dist/router.js", @@ -21,19 +21,19 @@ "author": "abearxiong", "license": "MIT", "devDependencies": { - "@kevisual/query": "^0.0.18", + "@kevisual/query": "^0.0.25", "@rollup/plugin-alias": "^5.1.1", "@rollup/plugin-commonjs": "^28.0.3", "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-typescript": "^12.1.2", "@types/lodash-es": "^4.17.12", - "@types/node": "^22.15.18", + "@types/node": "^22.15.29", "@types/ws": "^8.18.1", "@types/xml2js": "^0.4.14", "cookie": "^1.0.2", "lodash-es": "^4.17.21", "nanoid": "^5.1.5", - "rollup": "^4.40.2", + "rollup": "^4.41.1", "rollup-plugin-dts": "^6.2.1", "ts-loader": "^9.5.2", "ts-node": "^10.9.2", @@ -41,7 +41,7 @@ "typescript": "^5.8.3", "ws": "npm:@kevisual/ws", "xml2js": "^0.6.2", - "zod": "^3.24.4" + "zod": "^3.25.51" }, "repository": { "type": "git", @@ -89,6 +89,10 @@ "import": "./mod.ts", "require": "./mod.ts", "types": "./mod.d.ts" + }, + "./src/*": { + "import": "./src/*", + "require": "./src/*" } } } \ No newline at end of file diff --git a/readme.md b/readme.md index f802d49..c65fcba 100644 --- a/readme.md +++ b/readme.md @@ -1,23 +1,15 @@ # router -``` +```ts import { App } from '@kevisual/router'; const app = new App(); app.listen(4002); -new app.Route('demo', '01') - .define(async (ctx) => { - ctx.body = '01'; - return ctx; - }) - .addTo(app); - app .route({path:'demo', key: '02}) .define(async (ctx) => { ctx.body = '02'; - return ctx; }) .addTo(app); @@ -25,7 +17,6 @@ app .route('demo', '03') .define(async (ctx) => { ctx.body = '03'; - return ctx; }) .addTo(app); ```