国庆一家三口分开旅行,各有自己的目的地,我选了舟山,离开上海不远,之前从来没有去过。一人的旅行自然应该惬意为主,打着走到哪算哪的政策主张,也给自己埋下不少的坑。
国庆一家三口分开旅行,各有自己的目的地,我选了舟山,离开上海不远,之前从来没有去过。一人的旅行自然应该惬意为主,打着走到哪算哪的政策主张,也给自己埋下不少的坑。
This article will introduce the boot of Eggjs that is a Node.js web framework.
It is based on Koa and can satisfy your requirement through a large of plugins and middleware, even a your own framework. It is very important to create a cluster, an agent process and some worker processes when it is running. The cluster makes it stronger. Next, we can understand it by reading the source code.
Eggjs has a few major libs, egg-core、egg、egg-cluster、egg-bin、egg-scripts and so on.
egg-core: it extends Koa and is as a parent object of every agent and worker.
egg: it defines some actions for agent and worker, you can almost use these actions to create an app of a single process.
egg-cluster: it creates a cluster and manages them.
egg-scripts and Egg-bin: their job is run the whole app in a different environment.
Tips: We will discuss Eggjs with basing 2.x.x version.
如果不清楚什么是Egg.js,希望能移步到它的官网简单看下。另外说它是__约定大于配置__的话,我只能说你真的不了解它,或者说不了解框架,哪个框架没有约定?毕竟没有规矩不成方圆,何况是逻辑性的程序呢?官方列出的特性如下:
1.提供基于 Egg 定制上层框架 的能力
2.高度可扩展的插件机制
3.内置多进程管理
4.基于 Koa 开发,性能优异
5.框架稳定,测试覆盖率高
6.渐进式开发
第1条,它有那么Koa也有啊。第2条,它有,难道Koa、Express等就没有嘛?第4条,更好的补充了Koa不是更好吗?第5条,难道别的框架就不稳定了?第6条,前端鼓吹渐进式、后端也鼓吹,那究竟什么是渐进式呢?
在我看来最吸引我的是第3条,__内置多进程管理__,这个在其它主流nodejs框架中是稀缺的特性,此文就简单聊聊它。
Update your browser to view this website correctly. Update my browser now