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.



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

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

Published On September 5, 2020 7:32 PM

Last Updated September 5, 2020 7:32 PM