Update index.js file structure

Based on the structure from generator-webapp.