Update app.js

added support for https, retrieve domain from window object.