Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e6a520 commit ad4b7ffCopy full SHA for ad4b7ff
src/core/http.js
@@ -3,16 +3,13 @@
3
import request from 'superagent';
4
import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment';
5
6
-const getBaseUrl = (() => {
7
- let baseUrl;
8
- return () => baseUrl || (baseUrl = ExecutionEnvironment.canUseDOM ? '' :
+const getBaseUrl = () => ExecutionEnvironment.canUseDOM ? '' :
9
process.env.WEBSITE_HOSTNAME ?
10
`http://${process.env.WEBSITE_HOSTNAME}` :
11
- `http://127.0.0.1:${global.server.get('port')}`);
12
-})();
+ `http://127.0.0.1:${global.server.get('port')}`;
13
14
const http = {
15
-
+
16
get: path => new Promise((resolve, reject) => {
17
request
18
.get(getBaseUrl() + path)
0 commit comments