Skip to content

Commit 8246f85

Browse files
committed
chore: add khook in register
Signed-off-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
1 parent eac0754 commit 8246f85

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

v2/dedup/register.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ import cors from "cors";
77
const _ = require('lodash');
88
const khook = "keployWrappedExpress";
99
// @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();
1515

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+
}
2222

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

Comments
 (0)