Created
September 26, 2017 22:31
-
-
Save cfsghost/e4cf43bde07ee3f56d053a3a13ddd549 to your computer and use it in GitHub Desktop.
Groa.js : Koa-like gRPC Middleware Framework - example1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Groa = require('groa'); | |
const app = new Groa(); | |
// Add proto file | |
app.addProto(__dirname + '/example1.proto'); | |
// Add middleware | |
app.use(async (ctx, next) => { | |
// response | |
ctx.body = ctx.req.body; | |
}); | |
app.listen(50051, () => { | |
console.log('Listening on port 50051'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment