Skip to content

Commit 9fbceee

Browse files
committed
Move /1 into SERVER_URL constant
1 parent 54c9eb7 commit 9fbceee

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/CoreManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ var config: { [key: string]: mixed } = {
9292
!!process.versions &&
9393
!!process.versions.node),
9494
REQUEST_ATTEMPT_LIMIT: 5,
95-
SERVER_URL: 'https://api.parse.com',
95+
SERVER_URL: 'https://api.parse.com/1',
9696
VERSION: require('../package.json').version,
9797
APPLICATION_ID: null,
9898
JAVASCRIPT_KEY: null,

src/RESTController.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ var RESTController = {
139139
request(method: string, path: string, data: mixed, options?: RequestOptions) {
140140
options = options || {};
141141
var url = CoreManager.get('SERVER_URL');
142-
url += '/1/' + path;
142+
if (url[url.length - 1] !== '/') {
143+
url += '/';
144+
}
145+
url += path;
143146

144147
var payload = {};
145148
if (data && typeof data === 'object') {

src/__tests__/CoreManager-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var CoreManager = require('../CoreManager');
1313

1414
describe('CoreManager', () => {
1515
it('is initialized with default values', () => {
16-
expect(CoreManager.get('SERVER_URL')).toBe('https://api.parse.com');
16+
expect(CoreManager.get('SERVER_URL')).toBe('https://api.parse.com/1');
1717
});
1818

1919
it('pulls the version string from package.json', () => {

0 commit comments

Comments
 (0)