Connected server to javascript