Skip to content

Commit

Permalink
feat(microservice): new echo route
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Apr 21, 2022
1 parent e2bdd19 commit de12548
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/starter/microservice/src/route/echo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {app} from '../app.js';

app.route('post', '/echo', async (connection) => {
const jsonBody = await connection.requireJsonBody();
if (jsonBody == null) return;

connection.reply({
ok: true,
statusCode: 200,
data: {
jsonBody,
},
});
});

0 comments on commit de12548

Please sign in to comment.