7 Star 7 Fork 5

Gitee 极速下载 / minrouter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/cheft/minrouter.git
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
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

install

npm install minrouter

build

npm run build

run demo

# 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

空文件

简介

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) 展开 收起
JavaScript
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mirrors/minrouter.git
git@gitee.com:mirrors/minrouter.git
mirrors
minrouter
minrouter
master

搜索帮助