diff --git a/example/src/modules/httpInterfaceServer.ts b/example/src/modules/httpInterfaceServer.ts index d24e672..f983baa 100644 --- a/example/src/modules/httpInterfaceServer.ts +++ b/example/src/modules/httpInterfaceServer.ts @@ -218,8 +218,14 @@ export default class HTTPInterfaceServer extends AbstractInterfaceServer if (op === null || !AASCoreTypes.isOperation(op)) return res.status(404).end(); try { - this.onRequestCallback({ type: "invokeAction", target: op, extraData: { args: req.body, async: false } }); - return res.send(204).end(); + // This will probably need some rework in production code + const result = this.onRequestCallback({ type: "invokeAction", target: op, extraData: { args: req.body, async: false } }); + if (result) { + if (req.accepts("json")) res.setHeader("content-type", "application/json"); + return res.status(200).send(result).end(); + } else { + return res.status(204).end(); + } } catch { return res.status(500).end(); }