@@ -7,24 +7,24 @@ import cors from "cors";
7
7
const _ = require ( 'lodash' ) ;
8
8
const khook = "keployWrappedExpress" ;
9
9
// @ts -ignore
10
- // Hook(["express"], function (exports) {
11
- // console.log("Inside keploy hook...");
12
- // const expressApp = exports;
13
- // function keployWrappedExpress() {
14
- // const keployApp = expressApp();
10
+ Hook ( [ "express" ] , function ( exports ) {
11
+ console . log ( "Inside keploy hook..." ) ;
12
+ const expressApp = exports ;
13
+ function keployWrappedExpress ( ) {
14
+ const keployApp = expressApp ( ) ;
15
15
16
- // keployApp.use(bodyParser.json());
17
- // keployApp.use(cors());
18
- // keployApp.use(expressMiddleware());
19
- // keployApp.appliedMiddleware = true;
20
- // return keployApp;
21
- // }
16
+ keployApp . use ( bodyParser . json ( ) ) ;
17
+ keployApp . use ( cors ( ) ) ;
18
+ keployApp . use ( expressMiddleware ( ) ) ;
19
+ keployApp . appliedMiddleware = true ;
20
+ return keployApp ;
21
+ }
22
22
23
- // // copy the properties and methods of exported Function object into wrapped Funtion(keployWrappedExpress).
24
- // // In order to prevent "express._Method_ or express._Field_ is not declared" error.
25
- // // mixin(keployWrappedExpress, expressApp, false);
26
- // _.assign(keployWrappedExpress, expressApp);
27
- // exports = keployWrappedExpress;
28
- // return exports;
29
- // });
30
- export { expressMiddleware } ;
23
+ // copy the properties and methods of exported Function object into wrapped Funtion(keployWrappedExpress).
24
+ // In order to prevent "express._Method_ or express._Field_ is not declared" error.
25
+ // mixin(keployWrappedExpress, expressApp, false);
26
+ _ . assign ( keployWrappedExpress , expressApp ) ;
27
+ exports = keployWrappedExpress ;
28
+ return exports ;
29
+ } ) ;
30
+ export { khook } ;
0 commit comments