# cosjs **Repository Path**: iPuppy/cosjs ## Basic Information - **Project Name**: cosjs - **Description**: nodejs开发web服务器群集,主要针对页游,手游服务器端,可以方便的搭建web 服务器,同时又具有很高的扩展性。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 23 - **Created**: 2015-09-18 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README cosjs - a node.js web server =========================== This is a web server for node.js. easy to create web or mobile game server. Install with: npm install cosjs ## Usage Simple example, included as `test/index.js`: ```js var cosjs = require("cosjs"); var app = cosjs(); app.set('port',80); app.set('root',root); app.set('secret',Math.random().toString()); app.set('views',root + '/view'); app.set('view engine','ejs'); app.static('wwwroot'); app.router('all','/*/*/','api'); var cluster = cosjs.cluster; cluster.fork('http',app.start,require('os').cpus().length); cluster.start(); ``` ## Demo test/index.js