Using Existing API in custom express api

You can easily get access to any API by binding your api handler with scope variable defined in the begining when you define the api under initializeIndexes as shown in this section.

e.g

app.get("/hello",function(req,res){

 res.json({message : "hello"})

}.bind(scope)) // scope here is defined in the begining of initializeDb

Published On November 5, 2022 8:17 PM

Last Updated November 5, 2022 8:17 PM