typedserver/ts/servertools/classes.handlertypedrouter.ts

20 lines
562 B
TypeScript
Raw Normal View History

2024-02-20 16:30:46 +00:00
import * as plugins from '../plugins.js';
2023-03-30 13:15:48 +00:00
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);
2024-02-21 00:16:39 +00:00
res.type('json');
res.write(plugins.smartjson.stringify(response));
res.end();
2023-03-30 13:15:48 +00:00
});
}
}