1.0.0 • Published 7 years ago
koa-feather v1.0.0
feather
A lightweight web framework based on koa.
快速开始
app.js
var feather = require('koa-feather');
var app = feather();
router.get('/', function* (next){
yield this.render('index',{});
});
路由设置
https://github.com/alexmingoia/koa-router
- router.get
- router.post
模版引擎
feather-views在koa-views的基础上做了简单的修改,以支持模版的layout。
router.get('/u/:id', function* (next) {
yield this.render('user', {
'user': this.params.id
});
});
views/user.html
{{user}}
views/layout.html
{{>yield}}
Session配置
在项目的package.json中添加配置信息
"session": {
"keys": "your secret key"
}
1.0.0
7 years ago
0.0.22
8 years ago
0.0.21
8 years ago
0.0.20
8 years ago
0.0.19
8 years ago
0.0.18
8 years ago
0.0.17
8 years ago
0.0.16
8 years ago
0.0.15
8 years ago
0.0.14
8 years ago
0.0.13
8 years ago
0.0.12
8 years ago
0.0.11
8 years ago
0.0.10
9 years ago
0.0.9
9 years ago
0.0.8
9 years ago
0.0.7
9 years ago
0.0.6
9 years ago
0.0.5
9 years ago
0.0.4
9 years ago
0.0.3
9 years ago
0.0.2
9 years ago
0.0.1
9 years ago