adding most of app.js to web.js