Skip to content

Commit

Permalink
feat: add console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kirinnee committed Nov 9, 2023
1 parent dd6d71f commit 1777b24
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 @@ -74,6 +74,7 @@ function StartPlugin(plugin: ICyanPlugin): void {

const pluginService = new PluginService(plugin);
app.post("/api/plug", async (req: Request, res: Response) => {
console.log(req.body);
const result = await pluginService.plug(PluginMapper.ToDomain(req.body));
res.json(PluginMapper.ToRes(result));
});
Expand All @@ -94,6 +95,7 @@ function StartProcessor(processor: ICyanProcessor): void {

const processorService = new ProcessorService(processor);
app.post("/api/process", async (req: Request, res: Response) => {
console.log(req.body);
const result = await processorService.process(
ProcessorMapper.toDomain(req.body),
);
Expand All @@ -116,13 +118,15 @@ function StartTemplate(template: ICyanTemplate): void {

const templateService = new TemplateService(template);
app.post("/api/template/init", async (req: Request, res: Response) => {
console.log(req.body);
const result = await templateService.template(
TemplateInputMapper.answerToDomain(req.body),
);
res.json(TemplateOutputMapper.ToResp(result));
});

app.post("/api/template/validate", async (req: Request, res: Response) => {
console.log(req.body);
const result = await templateService.validate(
TemplateInputMapper.validateToDomain(req.body),
);
Expand All @@ -149,13 +153,15 @@ function StartExtension(ext: ICyanExtension): void {
const extService = new ExtensionService(ext);

app.post("/api/extension/init", async (req: Request, res: Response) => {
console.log(req.body);
const result = await extService.extend(
ExtensionMapper.extensionAnswerToDomain(req.body),
);
res.json(ExtensionOutputMapper.toResp(result));
});

app.post("/api/extension/validate", async (req: Request, res: Response) => {
console.log(req.body);
const result = await extService.validate(
ExtensionMapper.extensionValidateToDomain(req.body),
);
Expand Down

0 comments on commit 1777b24

Please sign in to comment.