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 ...
随机推荐
- 删除SVN文件 Delete SVN Folders.reg
批量删除文件夹里的SVN 文件 ------------------------------------------------------------------------------------ ...
- permeation开篇
学习方法: To follow the path look to the master follow the master walk with the master see through the m ...
- angular实现form验证
先上效果页面:https://lpdong.github.io/myForm-1/ 其中几个知识点 1.angularJs提供了几个新的type类型: type="password" ...
- Codeforces758C
C. Unfair Poll time limit per test:1 second memory limit per test:256 megabytes input:standard input ...
- Plugin execution not covered by lifecycle configuration的解决方案
pom配置文件中,提示错误:Plugin execution not covered by lifecycle configuration. 如图: 这表示m2e在其执行maven的生命周期管理时没有 ...
- 自己开发轻量级ORM(一)
在开发ORM之前,先简单的介绍下ORM的基本概念. 对象关系映射(Object Relational Mapping,简称ORM)是一种为了解决面向对象与关系数据库存在的互不匹配的现象的技术. 简单的 ...
- TimSort in Java 8
在项目中使用了Collections.sort(list, comparator)对集合进行了排序,偶然间遇到异常IllegalArgumentException: "Comparison ...
- WinForm——记住密码
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runti ...
- C#剪贴板对文件的复制、粘贴操作
1.把文件加到剪贴板: System.Collections.Specialied.StringCollection files=new System.Collections.Specialied.S ...
- Eval与Bind的区别
bind和eval都是ASP.NET中的函数,而且都有对将数据获取到Html中的功能.那么,它们在使用的时候有什么区别呢?在我们编程的时候,在某种情况下,用哪个函数更加合适呢? 区别 用法: 1. b ...