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 September 5, 2020 2:02 PM

Last Updated September 5, 2020 2:02 PM