import * as http from 'http' ; import { httpHeaders } from '../../http' ; import Handler from '../../handler' ; import Registry from '../../registry' ; /** Abstract Handler for deleting a variable. */ abstract class DeleteVariablesHandler implements Handler { VARIABLE_REGEXP = new RegExp ( '/ngapimock/variables/(.*)' ) ; param registry param variable param ngApimockId return abstract deleteVariable ( registry , variable , ngApimockId ? ) ; inheritDoc handleRequest ( request , response , next , registry , ngApimockId ) { this . deleteVariable ( registry , this . VARIABLE_REGEXP . exec ( request . url ) [ 1 ] , ngApimockId ) ; response . writeHead ( 200 , httpHeaders . CONTENT_TYPE_APPLICATION_JSON ) ; response . end ( ) ; } } export default DeleteVariablesHandler ;