UNPKG

newbeely-nodejs

Version:

简单易用的轻量级nodejs服务框架. 框架简单到只有组件逻辑,不同的组件提供不同的服务,使用外部的配置文件(只有一个配置文件)方便的组合成一个完整的服务框架. 整个服务使用bearcat(网易开源的nodejs面向切面编程的轻量级框架(AOP))管理,极大的解耦组件间的耦合.(关于代码热更新后续开放).

43 lines (39 loc) 701 B
/** * @filename hello * * @module hello * * @author Gandalfull <orientcountry@gmail.com> * @version 1 * @time 2016-02-19 10:03 */ var Bearcat = require('bearcat'); module.exports = function () { return Bearcat.getBean({ id: "api-hello", func: Hello, props: [ {name: "app", "ref": "application"} ] }); } function Hello() { } /** * http://127.0.0.1:port/hello * * @param msg * @param next */ Hello.prototype.handle = function (msg, next) { next(null, "hello newbeely!"); } /** * http://127.0.0.1:port/hello/world * * @param msg * @param next */ Hello.prototype.world = function (msg, next) { next(null, "hello world!"); }