目录 · 12 个章节
Introduction


var m = require('zeta').module('test',[])
.load()
.get('/', function ($scope) {
$scope.end('Hello World');
})
.app(8000);
Installation
npm install zeta
Features
Speed
- Fast, See our benchmark with express.
Module
- Angular-like Module Mechanism.

Service
- Angular-like Factory & Provider
- Dependency Injection for Factory & Handler
app
.provider('foo',{})
.factory('bar',function(foo){
return foo;
})
.get('/', function($scope, foo, bar){
})
Middleware
- More Flexible Approach to handle "Middleware"
app
.handler('login', function($scope){//stuff
})
.handler('checkLogin', function($scope,$cookie,db){
db.check($cookie.val('user'), function(ok){
if (ok){
$scope.go('next');
}else{
$scope.go('login');
}
});
})
.get('/home', ['checkLogin', function($scope){
$scope.end('welcome');
}]);
Error Handle
- Built-in Error Handle Support use Domain:
app
.guard.get().post('/')
.with(function($scope){
$scope.end('404 not found');
});
More
- Use Node Default Http Module: No Worries about Library Support like socket.io
- Built-in Factory & Handler: Ready To Use & Easy to Add
Quick Start
Tests
To run the test suite, first clone the code, install the dependancies, then run npm test:
$ git clone https://github.com/BenBBear/Zeta dir && cd dir
$ npm install
$ npm test
Contributors
License
MIT
喵