UNPKG

lynx-framework

Version:

lynx is a NodeJS framework for Web Development, based on decorators and the async/await support.

17 lines (16 loc) 656 B
import { Request as ERequest, Response as EResponse } from 'express'; import Response from './response'; /** * * This class simply wrap the original Response class in order to add async/await * functionality, improving code readability and maintenability. */ export default abstract class AsyncResponse extends Response { /** * Generate the correct response, injecting it to the standard Express response. * @param req the standard Express request * @param res the standard Express response */ abstract asyncResponse(req: ERequest, res: EResponse): Promise<void>; performResponse(req: ERequest, res: EResponse): void; }