0.0.7 • Published 12 years ago

youmeb-routes v0.0.7

Weekly downloads
4
License
-
Repository
github
Last release
12 years ago

youmeb-routes

範例 app

youmeb-routes-example-app

範例

var Routes = require('youmeb-routes');

//...

var app = express();

Routes.create(app)
  // 放 controller 的目錄,可以有多個目錄
  // 目錄下的 index 檔案用來設定一整個目錄
  // 像是 admin 這個目錄我就可以在他的 index 設定 {path: '/admin'}
  // 他會直接套用到 admin 下所有的 controller
  .source(path.join(__dirname, 'controllers'))
  .generate(function (err) {
    if (err) {
      return console.error(err);
    }
    http.createServer(app).listen(app.get('port'), function () {
      console.log('Express server listening on port ' + app.get('port'));
    });
  });
0.0.7

12 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago

0.0.0

12 years ago