Skip to content

Commit

Permalink
sdk/nodejs: cleanup example
Browse files Browse the repository at this point in the history
  • Loading branch information
lithdew committed Jun 15, 2020
1 parent fb5b21c commit 8dd92bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ import * as fs from "fs";

async function main() {
const node = new Node();
node.register("get_todos", (ctx: Context) => {
ctx.json(ctx.headers)
});

node.register("get_todos", (ctx: Context) => ctx.json(ctx.headers));
node.register("all_todos", (ctx: Context) => fs.createReadStream("tsconfig.json").pipe(ctx));

node.register('pipe', async (ctx: Context) => {
const body = await ctx.body({limit: 65536});
ctx.json(JSON.parse(body.toString("utf8")));
});

await node.dial("0.0.0.0:9000");
}

Expand Down

0 comments on commit 8dd92bb

Please sign in to comment.