• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

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

原作者: [db:作者] 来自: 网络 收藏 邀请

Cool-Node

A cool and light weight MVC framework for Node.js to build strongapplications, with abilities of auto-routing, cross-protocol, multi-apps,and beyond.

npm install cool-node --save

Please check out the documentation atcool-node.hyurl.com orhyurl.github.io/cool-node/.

If you're interested at new features in the next version, please visitProjects 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 otherframeworks, you had to define routes for every actions; when you were usingsocket.io, you complained writing too much socket.on() and socket.emit(). Andthinking, 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 withoutany 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 thingsthat matter, like manipulate models, writing controllers, and design views.With the ability of Modelar (a module for handling models and queries), youcan handle data in just few seconds.

Cross-Protocol Development

Cool-Node also give you the ability to handle sessions and share their statusacross HTTP and WebSocket, what you can do with a HTTP request can also bedone with a WebSocket communication.

Multi-Apps Development

Cool-Node is a framework that can build multiple applications at one time withonly one server running. It can differ requests (whether they come form HTTPor WebSocket) by subdomains, you can use more than one subdomain to write anycount of applications as you want.

Multi-Processing Development

Node.js is a server environment runs in single thread, although asynchronousI/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 ofefficiency 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):

<!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>

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap