Fixed cross site access issue

Browsers treat hostname and ip address of the same server to be
two different sites. As a result, this two "sites" cannot access
each other(cross-site access is block by browsers for security
reason) which cause problems of our UI. This commit attempted to
fixed that by rendering the basePath at run-time instead of using
static ip address, so that we can make browsers treat access to be
same site.