1.0.1 • Published 9 years ago
express-protobuf v1.0.1
Express-Protobuf
extend express response. you can use res.protobuf to send a protobuf protocol data;
How to use.
config
var protobuf = require('express-protobuf');
app.use(protobuf({
proto: path.join(__dirname, 'proto/bundle.json'),
http: true
}));use
awesomepackage.AwesomeMessage
res.protobuf('awesomepackage.AwesomeMessage', {
awesomeField: "AwesomeString"
});options
proto
The .proto file path. It should be a json format.
http
Specifies the boolean or string to be the value for support a api for proto defind.
booleaniftruethe application while offer API to response the protobuf defind. default url is/proto.stringthe protobuf defind api url. e.g,/api/proto