Skip to content

Commit

Permalink
fix: close stream, since proxy streams
Browse files Browse the repository at this point in the history
  • Loading branch information
kirinnee committed Nov 9, 2023
1 parent 05a752a commit e66c75f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sdks/node/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function StartPlugin(plugin: ICyanPlugin): void {
console.log(req.body);
const result = await pluginService.plug(PluginMapper.ToDomain(req.body));
res.json(PluginMapper.ToRes(result));
res.end();
});

app.listen(port, "0.0.0.0", () => {
Expand All @@ -100,6 +101,7 @@ function StartProcessor(processor: ICyanProcessor): void {
ProcessorMapper.toDomain(req.body),
);
res.json(ProcessorMapper.toRes(result));
res.end();
});

app.listen(port, "0.0.0.0", () => {
Expand All @@ -123,6 +125,7 @@ function StartTemplate(template: ICyanTemplate): void {
TemplateInputMapper.answerToDomain(req.body),
);
res.json(TemplateOutputMapper.ToResp(result));
res.end();
});

app.post("/api/template/validate", async (req: Request, res: Response) => {
Expand All @@ -134,6 +137,7 @@ function StartTemplate(template: ICyanTemplate): void {
valid: result,
} satisfies TemplateValidRes;
res.json(r);
res.end();
});

app.listen(port, "0.0.0.0", () => {
Expand All @@ -158,6 +162,7 @@ function StartExtension(ext: ICyanExtension): void {
ExtensionMapper.extensionAnswerToDomain(req.body),
);
res.json(ExtensionOutputMapper.toResp(result));
res.end();
});

app.post("/api/extension/validate", async (req: Request, res: Response) => {
Expand All @@ -169,6 +174,7 @@ function StartExtension(ext: ICyanExtension): void {
valid: result,
} satisfies ExtensionValidRes;
res.json(r);
res.end();
});

app.listen(port, "0.0.0.0", () => {
Expand Down

0 comments on commit e66c75f

Please sign in to comment.