明河,前端工程师,就职于淘宝网。
除特别声明外,本书中的内容使用CC BY-SA 3.0 License(创作共用 署名-相同方式共享3.0许可协议)授权 。
koa.js实战
明河,前端工程师,就职于淘宝网。
除特别声明外,本书中的内容使用CC BY-SA 3.0 License(创作共用 署名-相同方式共享3.0许可协议)授权 。
should断言库这个章节的那一段代码在我这里运行不起来,一直提示我没有should模块,我应该怎样引入该模块呢?使用以下命令还是不行
npm i should -g
希望看到的老师们帮我解答一下。
alias nod="node --harmony"
=》
alias node="node --harmony"
koa2中间件都不用Generator了,貌似要精致一点,大佬有没有时间更新一下呢
koa中间件实现原理中
return co(function *(){
......
})();
代码有问题,改为如下
return co(function *(){
......
});
co的执行方式直接为co(gen);
http://book.apebook.org/minghe/koa-action/xtemplate/senior.html
`include() 引用子模板
x.xtpl 与 y.xtpl 同级目录,y.xtpl 引用子模板x.tpl:
{{{include("x")}}}
留意是{{{}}}。`
但是发现用生成器生成的是模板用的是两个{}(官方的文档也是两个括号)。试了一下,用两个或者三个都一样的?
希望能以一个blog系统,数据走ajax的简单实例来循序渐进的开讲下koa,内资料太少
最近后台系统项目准备用的做前后端完全分离,还有些东西不知道怎么入手
根据书中例子 我在demo.js 中写了
app.use(function *(){
this.demo = 'test text';
});
app.use(function *(){
this.body = this.demo;
});
但是 貌似 运行的时候,没有进入第二个 ,页面显示 no found
求大神给看一下原因
学习的曲线是先难后易,先苦后点
,错字。
The great book hasn't been update for quite a long time ?
Nothing changed these days ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.