在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
Cool-NodeA 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
Auto-Routing DevelopmentRemember 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 DevelopmentAlong 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 DevelopmentCool-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 DevelopmentCool-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 DevelopmentNode.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. ExampleIn JavaScript ( 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 ( <!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> |
请发表评论