reinitializing eslint
This commit is contained in:
@@ -25,3 +25,6 @@ export interface put_handler {
|
||||
export interface trace_handler {
|
||||
async handle_trace_request(req: Request, res: Response): void
|
||||
}
|
||||
|
||||
export default {all_handler,delete_handler,get_handler,head_handler,post_handler,put_handler,
|
||||
trace_handler}
|
4
lib/index.ts
Normal file
4
lib/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import handler_interfaces from './handler_interfaces';
|
||||
import Transaction from './transaction';
|
||||
|
||||
export handler_interfaces;
|
@@ -1,7 +1,7 @@
|
||||
import consts from '@scode/consts';
|
||||
import {Request,Response} from 'express';
|
||||
import {Request, Response} from '@types/express';
|
||||
|
||||
class Transaction {
|
||||
export default class Transaction {
|
||||
/* private */
|
||||
private _req: Request;
|
||||
private _res: Response;
|
||||
@@ -15,14 +15,15 @@ class Transaction {
|
||||
public get res(): Response => this._res;
|
||||
|
||||
/* constructor */
|
||||
public Request(req: Request,res: Response) {
|
||||
public Transaction(req: Request,res: Response) {
|
||||
this._req = req;
|
||||
this._res = res;
|
||||
}
|
||||
|
||||
/* methods */
|
||||
public end() {
|
||||
public end(data: any) {
|
||||
if (this.status !== -1)
|
||||
this.res.setHeader(this.status);
|
||||
this._res.status(this.status);
|
||||
this._res.end(data);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user