Paloma 详细介绍app
Paloma 是一个类 Angular 的 Node.js MVC 框架。框架
特性:koa
依赖注入ui
基于 koa@2this
例子:get
'use strict'; const Paloma = require('paloma'); const app = new Paloma(); app.controller('indexCtrl', function (ctx, next, indexService) { ctx.body = `Hello, ${indexService.getName()}`; }); app.service('indexService', function () { this.getName = function () { return 'paloma'; }; }); app.route({ method: 'GET', path: '/', controller: 'indexCtrl' }); app.listen(3000);