vframe-server-pomelo-protobuf
vframe-server-pomelo-protobuf is a plugin for pomelo, it can be used in pomelo(>=0.9).
vframe-server-pomelo-protobuf provides messages encode&decode service for pomelo, and it uses ProtoBuf.js to do this thing.
##Installation
npm install vframe-server-pomelo-protobuf
##Usage
the protos file should use json format, for it would be compatible for pomelo-protobuf. If you use proto file, you can use ProtoBuf.js to turn it to json file.
the default protos files are /config/serversProtos.json and /config/clientProtos.json, and you can specify your own protos files.
var protobuf = require('vframe-server-pomelo-protobuf');
app.use(protobuf, {
protobuf: {
// serverJsonsPath: /your_proto_json_file_path/
// clientJsonsPath: /your_proto_json_file_path/
//serverProtosPath: '../shared/proto/serverProtos.proto',
//clientProtosPath: '../shared/proto/clientProtos.proto',
}
});