4 Star 3 Fork 0

Gitee 极速下载 / Cool-Node

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/Hyurl/cool-node
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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

<!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>
Copyright 2017 Ayon Lee Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Cool-Node 是一个基于 Node.js 平台的轻量级 Web 应用程序框架 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/mirrors/Cool-Node.git
git@gitee.com:mirrors/Cool-Node.git
mirrors
Cool-Node
Cool-Node
master

搜索帮助