0.7.0 • Published 10 years ago

zeta v0.7.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

Introduction

npm version npm.io npm.io

logo

var m = require('zeta').module('test',[])

.load()
.get('/', function ($scope) {
  $scope.end('Hello World');
})
.app(8000);

Installation

npm install zeta

Features

Speed

npm.io

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');
}]);
  • Handlers Collaboration: Component Injection for $scope
app
.h('h1', function($scope){
    $scope
       .provide('localInfo', 'hello world')  //then 'localInfo' will be available for injection in the following handlers
       .go('next');
})

.h('h2', function($scope, localInfo){
    $scope.end(localinfo)  // => hello world
})

.get('/', ['h1', 'h2']);

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

  1. Our Guide is a nice place to get start.
  2. You could bootstrap your code from zeta-seed.

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

0.7.0

10 years ago

0.6.1

10 years ago

0.6.0

10 years ago

0.5.5

10 years ago

0.5.4

10 years ago

0.5.3

10 years ago

0.5.2

11 years ago

0.5.1

11 years ago

0.5.0

11 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.0

11 years ago