diff --git a/nodejs/src/index.ts b/nodejs/src/index.ts index 3cb8b73..715b445 100644 --- a/nodejs/src/index.ts +++ b/nodejs/src/index.ts @@ -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"); }