KoaHub平台基于Node.js开发的Koa EJS渲染插件代码信息详情
koa-ejs
ejs render middleware for koa
koa-ejs
Koa ejs view render middleware. support all feature of ejs.

Usage
Example
var koa = require('koa');
var render = require('koa-ejs');
var app = koa();
render(app, {
root: path.join(__dirname, 'view'),
layout: 'template',
viewExt: 'html',
cache: false,
debug: true
});
app.use(function *() {
yield this.render('user');
});
app.listen(7001);
Or you can checkout the example.
settings
- root: view root directory.
- layout: global layout file, default is
layout, setfalseto disable layout. - viewExt: view file extension (default
html). - cache: cache compiled templates (default
true). - debug: debug flag (default
false). - delimiter: character to use with angle brackets for open / close (default
%).
Layouts
koa-ejs supports layouts. The default layout file is layout. If you want to change default layout file, use settings.layout. Also you can specify layout byoptions.layout in yield this.render. Also you can set layout = false to disable the layout.
<html>
<head>
<title>koa ejs</title>
</head>
<h3>koa ejs</h3>
<body>
<%- body %>
</body>
</html>
Inlcude
Supports ejs includes.
State
Support ctx.state in koa.
Licences
(The MIT License)
Copyright (c) 2014 dead-horse and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
wemall 开源微商城 ,微信商城,商城源码,三级分销,微生鲜,微水果,微外卖,微订餐---专业的o2o系统
wemall地址:http://www.wemallshop.com
代码来源:http://js.koahub.com/home/feature/koa-jwt

KoaHub平台基于Node.js开发的Koa EJS渲染插件代码信息详情的更多相关文章
- KoaHub平台基于Node.js开发的Koa 连接支付宝插件代码信息详情
KoaHub平台基于Node.js开发的Koa 链接支付宝插件代码信息详情 easy-alipay alipay payment & notification APIs easy-alipay ...
- KoaHub平台基于Node.js开发的Koa JWT认证插件代码信息详情
koa-jwt Koa JWT authentication middleware. koa-jwt Koa middleware that validates JSON Web Tokens and ...
- KoaHub平台基于Node.js开发的Koa router路由插件代码信息详情
koa-router Router middleware for koa. Provides RESTful resource routing. koa-router Router mid ...
- KoaHub平台基于Node.js开发的Koa的skip插件代码详情
koahub-skip koahub skip middleware koahub skip Conditionally skip a middleware when a condition is m ...
- KoaHub平台基于Node.js开发的Koa的简单包装到请求库的类似接口
co-request co-request promisify wrapper for request co-request Simple wrapper to the request library ...
- KoaHub平台基于Node.js开发的Koa的调试实用程序
debug small debugging utility debug tiny node.js debugging utility modelled after node core's debugg ...
- KoaHub平台基于Node.js开发的Koa的连接MongoDB插件代码详情
koa-mongo MongoDB middleware for koa, support connection pool. koa-mongo koa-mongo is a mongodb midd ...
- KoaHub平台基于Node.js开发的Koa的rewrite and index support插件代码详情
koa-static-server Static file serving middleware for koa with directory, rewrite and index support k ...
- KoaHub平台基于Node.js开发的Koa的get/set session插件代码详情
koa-session2 Middleware for Koa2 to get/set session use with custom stores such as Redis or mongodb ...
随机推荐
- HTML 颜色
HTML 颜色 HTML 颜色由红色.绿色.蓝色混合而成. 颜色值 HTML 颜色由一个十六进制符号来定义,这个符号由红色.绿色和蓝色的值组成(RGB). 种颜色的最小值是0(十六进制:#00).最大 ...
- HDU4474
Yet Another Multiple Problem Time Limit: 40000/20000 MS (Java/Others) Memory Limit: 65536/65536 K ...
- POJ3728 LCA RMQ DP
题意简述:给定一个N个节点的树,1<=N<=50000 每个节点都有一个权值,代表商品在这个节点的价格.商人从某个节点a移动到节点b,且只能购买并出售一次商品,问最多可以产生多大的利润. ...
- ADO.NET 扩展属性、配置文件 和 对战游戏
扩展属性 有外键关系时将信息处理成用户可看懂的 利用扩展属性 如:Info表中的民族列显示的是民族代号处理成Nation表中的民族名称 需要在Info类里面扩展一个显示nation名称的属性 例:先前 ...
- 你需要了解的 Core Spotlight
你需要了解的 Core Spotlight -- 了解Spotlight Core Spotlight是iOS 9中苹果推出了新的Search API,可以直接搜App内的内容(in-App Sear ...
- Orcale 之基本术语二
表空间 表空间是 Orcale 数据库最大的逻辑结构.表空间就是一个或者多个数据文件的集合.所有的数据文件都被逻辑的存放在表空间中. 一个数据库包括 SYSTEM.SYSAUX和TMP三个默认表空间, ...
- bzoj1492--斜率优化DP+cdq分治
显然在某一天要么花完所有钱,要么不花钱. 所以首先想到O(n^2)DP: f[i]=max{f[i-1],(f[j]*r[j]*a[i]+f[j]*b[i])/(a[j]*r[j]+b[j])},j& ...
- 游戏UI框架设计(一) : 架构设计理论篇
游戏UI框架设计(一) ---架构设计理论篇 前几天(2017年2月)看到一篇文章,国内王健林.马云等大咖们看好的未来十大最有"钱途"产业中,排名第一的就是"泛娱乐&qu ...
- checkinstall包的使用
1. Checkinstall是个很有用的工具.当软件编译过后,Checkinstall能够帮助安装. 下面的命令是安装软件 ./configure make make install 但是用这种安装 ...
- vue路由表(简单)
import Vue from 'vue'import VueRouter from 'vue-router'Vue.use(VueRouter) const first = { template: ...