# minrouter **Repository Path**: mirrors/minrouter ## Basic Information - **Project Name**: minrouter - **Description**: a micro middleware router that can be used in both client-side (e.g. dot.js, vue, react, preact) and server-side applications (e.g. Node.js/Express, Koa) - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 7 - **Forks**: 5 - **Created**: 2017-06-23 - **Last Updated**: 2025-12-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # minrouter a micro middleware router that can be used in both client-side (e.g. dot.js, vue, react, preact) and server-side applications (e.g. Node.js/Express, Koa) ## features * support koa * support express * support browser pushState & replaceState * middleware router, API like express ## preview ![preview](preview.gif) ## install npm install minrouter ## build npm run build ## run demo ```shell # build the web code npm run demo # http://localhost:3000 npm run express or # http://localhost:4000 npm run koa or # http://localhost:4000 npm run preact ``` ## usage > see demo directory code ## api * Router.get(path, fn) * Router.addResMethod(name, fn) * Router.go(path, isReplace) __only browser__ * Router.back() __only browser__ * Router.proxyLinks(nodes) __only browser__ * req.query & req.params, this.ctx, this.ctx.res > see src/minrouter.js