KoaHub.js:使用ES6/7特性开发Node.js框架
KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架。可以直接在项目里使用 ES6/7(Generator Function, Class, Async & Await)等特性,借助 Babel 编译,可稳定运行在 Node.js 环境上。
介绍
KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架。可以直接在项目里使用 ES6/7(Generator Function, Class, Async & Await)等特性,借助 Babel 编译,可稳定运行在 Node.js 环境上。
项目中可以使用 ES6/7 里的所有特性,借助 Babel 编译,可以稳定运行在 >=0.12.0 的 Node.js 环境中。
组件1:koahub-loader
Installation
Use with koa
组件2: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
method
it could be an string or an array of strings. If the request method match the middleware will not run.path
it could be an string, a regexp or an array of any of those. If the request path match, the middleware will not run.ext
it could be an string or an array of strings. If the request path ends with one of these extensions the middleware will not run.custom
it 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 viathis
useOriginalUrl
it should betrue
orfalse
, default istrue
. if false,path
will match againstctx.url
instead 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:使用ES6/7特性开发Node.js框架的更多相关文章
- KoaHub.js:使用ES6/7特性开发Node.js框架(2)
介绍 KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架.可以直接在项目里使用 ES6/7(Generator Function, Class, Async ...
- [Node.js] Using ES6 and beyond with Node.js
If you're used to using all the latest ES6+ hotness on the front end via Babel, working in Node.js c ...
- Atitit js es5 es6新特性 attilax总结
Atitit js es5 es6新特性 attilax总结 1.1. JavaScript发展时间轴:1 1.2. 以下是ES6排名前十的最佳特性列表(排名不分先后):1 1.3. Es6 支持情况 ...
- VS轻松开发Node.js应用
PTVS开发团队又开发出一款可以在VS里编写Node.js应用程序的插件--NTVS(Node.js Tools for Visual Studio),开发者可以在VS里轻松开发Node.js应用. ...
- 在Visual Studio上开发Node.js程序(2)——远程调试及发布到Azure
[题外话] 上次介绍了VS上开发Node.js的插件Node.js Tools for Visual Studio(NTVS),其提供了非常方便的开发和调试功能,当然很多情况下由于平台限制等原因需要在 ...
- 在Visual Studio上开发Node.js程序
[题外话] 最近准备用Node.js做些东西,于是找找看能否有Visual Studio上的插件以方便开发.结果还真找到了一个,来自微软的Node.js Tools for Visual Studio ...
- 【转】使用VS开发 Node.js指南
参考:https://www.visualstudio.com/features/node-js-vs 这篇文章主要介绍了使用VS开发 Node.js的方法,主要是使用NTVS(Node.js Too ...
- 在开发node.js中,关于使用VS2013插件出现一直读取资源的问题
情况描述: 1.安装了VS2013: 2.安装了VS开发node.js的插件; 3.打开以前的工程文件,有的可以打开,有的打不开.而且打不开的始终停留在读取资源的界面.很痛苦的.等半天都没有反应.到底 ...
- 在Visual Studio 2013 上开发Node.js程序
[题外话] 最近准备用Node.js做些东西,于是找找看能否有Visual Studio上的插件以方便开发.结果还真找到了一个,来自微软的Node.js Tools for Visual Studio ...
随机推荐
- php中二维数组如何使用
最近需要使用PHP中的二维数组,就用一个简单的例子来说明PHP中二数组是如何使用 <?php $a=array('a','b','c'); $c=array('a1','b1','c1'); $ ...
- HTML 样式- CSS
如何使用CSS CSS 是在 HTML 4 开始使用的,是为了更好的渲染HTML元素而引入的. CSS 可以通过以下方式添加到HTML中: 内联样式- 在HTML元素中使用"style&qu ...
- Android项目中打jar包 和 使用
第一步,把普通的android project设置成库项目 库项目也是一个标准的android项目,因此你先创建一个普通的android项目. 这个项目可以起任何的名称,任何的报名,设置其他需要设置的 ...
- Canvas贝塞尔二级曲线
当前点到控制点,控制点到末尾点的两个连线,与这两个连线相切:<!DOCTYPE html> <html lang="en"> <head> &l ...
- Tomcat使用常见问题
1,启动服务器,闪退问题 原因:tomcat软件是用java语言开发的,软件启动时,会默认到系统环境变量中查找一个名叫JAVA_HOME的变量.这个变量的作用是找到tomcat启动所需的JVM. ...
- css之描点定位方式
<!-- 描点定位的两张方式 --> <!-- 1.通过id定位 --> <!-- 2.通过name定位 只能用a--> <div> <a hre ...
- C++编程练习(13)----“排序算法 之 堆排序“
堆排序 堆是具有下列性质的完全二叉树:每个结点的值都大于或等于其左右孩子结点的值,称为大顶堆(也叫最大堆):或者每个结点的值都小于或等于其左右孩子结点的值,称为小顶堆(也叫最小堆). 最小堆和最大堆如 ...
- PHP 数组处理
一:PHP 定义数组: PHP 代码 不能再 空的位置 打字 会报错 定义数组 方式1 $cars=array("Volvo","BMW","T ...
- Swift 2.0 UIAlertView 和 UIActionSheet 的使用
在 IOS 9.0 之后, UIAlertView 是 给废弃了的,虽然你要使用的话,暂时还是可以的,但是在 9.0 之后,IOS 推荐大家使用的是 UIAlertController 这个控制器 ...
- 修改UITextField的占位文字颜色的三种层次
层次一:利用富文本 // 描述占位文字属性 NSMutableDictionary *dict = [NSMutableDictionary dictionary] ; dict[NSForegrou ...