0.1.6 • Published 9 years ago

webjs-cli v0.1.6

Weekly downloads
30
License
Repository
github
Last release
9 years ago

webjs npm version

Installation

$ [sudo] npm install -g webjs-cli

Create a new app

$ webjs new my_app

Features  

Call any service from any controller!

// No need to require your service! :O
var fn = require('../services/myService.js'); // [ X ]
fn.findInArray(users, "id", 1);

// Simply use them in your controllers by the service name B|
myService.findInArray(users, "id", 1); // [ √ ]

Routes  

/*
 * Routes Config
 */
module.exports {
  // Examples
  '/': 'SampleController.getInfo',
  'POST /user': 'UserController.create',
  // you may also render a view like this
  '/home': 'home'
}

Controllers  

/*
 * SampleController
 */
module.exports {
  //action
  getInfo: function(req, res){
    SampleService.findInArray(req.param.users, "id", "72A4FC83EF812BA1");
    res.send("ready");
  },
  main: function(req, res){
    res.render("home");
  }
}

Services  

/*
 * SampleService
 */
module.exports {
  //action
  findInArray: function(array, key, value){
    ...
  }
}
0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago