A cool and light weight MVC framework for Node.js to build strong applications, with abilities of auto-routing, cross-protocol, multi-apps, and beyond.
npm install cool-node --save
Please check out the documentation at cool-node.hyurl.com or hyurl.github.io/cool-node/.
If you're interested at new features in the next version, please visit Projects for plans.
Remember when you were using the Node.js internal server or Express, or other frameworks, you had to define routes for every actions; when you were using socket.io, you complained writing too much socket.on() and socket.emit(). And thinking, isn't there any way not to do this? So here comes Cool-Node.
Cool-Node provides an API that will automatically handle these things without any of your concerns, you don't even have to call this API in your program, all actions will be automatically done by the framework itself.
Along with auto-routing system, you can save you time to do the real things that matter, like manipulate models, writing controllers, and design views. With the ability of Modelar (a module for handling models and queries), you can handle data in just few seconds.
Cool-Node also give you the ability to handle sessions and share their status across HTTP and WebSocket, what you can do with a HTTP request can also be done with a WebSocket communication.
Cool-Node is a framework that can build multiple applications at one time with only one server running. It can differ requests (whether they come form HTTP or WebSocket) by subdomains, you can use more than one subdomain to write any count of applications as you want.
Node.js is a server environment runs in single thread, although asynchronous I/O gives the power to handle high concurrency, but it's not enough! Multiprocessing allows you running multiple server instances in your system, taking absolute advantages of multiple CPUs, and improve several times of efficiency of your website.
In JavaScript (/App/Controllers/HttpTest.js
):
const HttpController = require("./HttpController");
module.exports = class extends HttpController{
/** GET /HttpTest/ */
index(){
return this.view({
title: "Cool-Node Test",
content: "Hello, World!"
});
}
}
And in the HTML (/App/Views/HttpTest/index.html
):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><%=title%></title>
</head>
<body>
<h1><%-content%></h1>
</body>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型