typedserver/ts/servertools/classes.handlertypedrouter.ts
2024-02-20 17:30:46 +01:00

18 lines
520 B
TypeScript

import * as plugins from '../plugins.js';
import { Handler } from './classes.handler.js';
import * as interfaces from '../interfaces/index.js';
export class HandlerTypedRouter extends Handler {
/**
* The constuctor of HandlerProxy
* @param remoteMountPointArg
*/
constructor(typedrouter: plugins.typedrequest.TypedRouter) {
super('POST', async (req, res) => {
const response = await typedrouter.routeAndAddResponse(req.body);
res.json(plugins.smartjson.stringify(response));
});
}
}