Revised index.js to app.js