KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架之koahub-skip
koahub-skip
koahub skip middleware
koahub skip
Conditionally skip a middleware when a condition is met.
Install
npm i koahub-skip --save
Usage
With existing middlewares:
If you are authoring a middleware you can support skip as follow:
Current options
methodit could be an string or an array of strings. If the request method match the middleware will not run.pathit could be an string, a regexp or an array of any of those. If the request path match, the middleware will not run.extit could be an string or an array of strings. If the request path ends with one of these extensions the middleware will not run.customit must be a function that returnstrue/false. If the function returns true for the given request, ithe middleware will not run. The function will have access to Koa's context viathisuseOriginalUrlit should betrueorfalse, default istrue. if false,pathwill match againstctx.urlinstead ofctx.originalUrl.
Examples
Require authentication for every request skip the path is index.html.
Avoid a fstat for request to routes doesnt end with a given extension.

KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架之koahub-skip的更多相关文章
- KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架之koahub
Installation $ npm install koahub Use with koa var app = require('koa')(); var router = require( ...
- KoaHub.js是基于 Koa.js 平台的 Node.js web 快速开发框架
koahubjs KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架.可以直接在项目里使用 ES6/7(Generator Function, Class, A ...
- 基于 Koa.js 平台的 Node.js web 快速开发框架KoaHub.js demo 可安装
KoaHub.js demo KoaHub.js KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架.可以直接在项目里使用 ES6/7(Generator Fu ...
- KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架之koahub-yilianyun
koahub-yilianyun 微信易联云打印机接口 koahub-yilianyun易联云打印机node接口 Installation $ npm install koahub-yilianyun ...
- io.js - 兼容 NPM 平台的 Node.js 新分支
io.js(JavaScript I/O)是兼容 NPM 平台的 Node.js 新分支,由 Node.js 的核心开发者在 Node.js 的基础上,引入更多的 ES6 特性,它的目的是提供更快的和 ...
- nw.js桌面程序自动更新(node.js表白记)
Hello Google Node.js 一个基于Google V8 的JavaScript引擎. 一个伟大的端至端语言,或许我对你的热爱源自于web这门极富情感的技术吧! 注: 光阴似水,人生若梦, ...
- Node.js 学习笔记(一)--------- Node.js的认识和Linux部署
Node.js 一.Node.js 简介 简单的说 Node.js 就是运行在服务端的可以解析并运行 JavaScript 脚本的软件. Node.js 是一个基于Chrome JavaScript ...
- [Node.js] 00 - Where do we put Node.js
Ref: 前后端分离的思考与实践(五篇软文) 其实就是在吹淘宝自己的Midway-ModelProxy架构. 第一篇 起因 为了提升开发效率,前后端分离的需求越来越被重视, 同一份数据接口,我们可以定 ...
- 基于 Markdown 的开源的 Node.js 知识库平台
Raneto 是一个免费,开源的 Node.js 知识库平台,基于静态 Markdown 文件实现. Raneto 可以被称为静态网站生成器,因为它并不需要数据库支持.所有的内容都存储在 Markdo ...
随机推荐
- Raphael的鼠标over move out事件
Raphael的鼠标over move out事件 <%@ page language="java" contentType="text/html; charset ...
- eclipse xml自动提示
找到所需要的dtd文件: window->preferences->xml->xml catalog : public id 输入对应的字符串:
- easyUI parser的使用
easyUI parser的使用: <!DOCTYPE html> <html lang="en"> <head> <meta chars ...
- .Net多线程编程—使用Visual Studio 2012进行调试
1 相关概念 1)栈帧 C语言中,每个栈帧对应着一个未运行完的函数.栈帧中保存了该函数的返回地址和局部变量. 栈帧也叫过程活动记录,是编译器用来实现过程/函数调用的一种数据结构. 2)单步执行与单步函 ...
- jq基础
$(function() { $(".dd").attr("class","cc").append("<h ...
- Hadoop权威指南: InputFormat,RecordReader,OutputFormat和RecordWriter
InputFormat和RecordReader Hadoop提出了InputFormat的概念 org.apache.hadoop.mapreduce包里的InputFormat抽象类提供了如下列代 ...
- xshell无法连接到linux主机原因分析
xshell连接linux主机时,会出现错误:Could not connect to '192.168.89.144' (port 22): Connection failed. 但是这时能pin ...
- 常用的JQ函数
/// <reference path="jquery-1.8.0.min.js"> /* * DIV或元素居中 * @return */ jQuery.fn.mCen ...
- 计算机程序的思维逻辑 (64) - 常见文件类型处理: 属性文件/CSV/EXCEL/HTML/压缩文件
对于处理文件,我们介绍了流的方式,57节介绍了字节流,58节介绍了字符流,同时,也介绍了比较底层的操作文件的方式,60节介绍了随机读写文件,61节介绍了内存映射文件,我们也介绍了对象的序列化/反序列化 ...
- bootstrap table编辑操作的时候 在模态框里加载iframe页面(加载的页面是在另一个页面做编辑)的时候如何关闭模态框和刷新table
//关闭模态框 window.parent.$('#myModal').modal('hide'); //修改成功后刷新table表格 ...