Cool-Node 是一个基于 Node.js 平台的轻量级 Web 应用程序框架

网友投稿 737 2022-10-11

Cool-Node 是一个基于 Node.js 平台的轻量级 Web 应用程序框架

Cool-Node 是一个基于 Node.js 平台的轻量级 Web 应用程序框架

Cool-Node

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.

Main Features

Based on Class and MVC, New Style of Controllers and Models.Fully Asynchronous Controllers.Auto Request & Response Handlers.Cross Protocol and Multiple Apps on One Server.Multi-Processing and Internationalization.

Auto-Routing Development

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.

Fast Development

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.

Cross-Protocol Development

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.

Multi-Apps Development

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.

Multi-Processing Development

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.

Example

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):

<%=title%>

<%-content%>

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:drf serializer获取viewset 中的上下文context,自定义上下文
下一篇:docker-compose 文件参考
相关文章

 发表评论

暂时没有评论,来抢沙发吧~