import * as http from 'http' ; import { httpHeaders } from '../../http' ; import Handler from '../../handler' ; import Registry from '../../registry' ; /** Abstract Handler for Recording the response. */ abstract class RecordResponseHandler implements Handler { param registry param ngApimockId abstract record ( registry , ngApimockId ? ) ; inheritDoc handleRequest ( request , response , next , registry , ngApimockId ) { this . record ( registry , ngApimockId ) ; response . writeHead ( 200 , httpHeaders . CONTENT_TYPE_APPLICATION_JSON ) ; response . end ( JSON . stringify ( { record : registry . record } ) ) ; } } export default RecordResponseHandler ;