Update index.js

modified to work as express route with AppSuite