Skip to content

Commit 3eefe40

Browse files
committed
load files from parent
1 parent b711eef commit 3eefe40

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎src/lib/brand.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
module.exports = {
44
APP_NAME: 'CodeTorch',
55
APP_DOMAIN: 'https://codetorch.net',
6+
API_HOST: 'http://localhost:8093',
67
DEFAULT_CLOUD_HOST: 'wss://cloud.codetorch.net'
78
};

‎src/lib/project-fetcher-hoc.jsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
33
import {intlShape, injectIntl} from 'react-intl';
44
import bindAll from 'lodash.bindall';
55
import {connect} from 'react-redux';
6+
const {API_HOST} = require('./brand');
67

78
import {setProjectUnchanged} from '../reducers/project-changed';
89
import {
@@ -198,8 +199,8 @@ const ProjectFetcherHOC = function (WrappedComponent) {
198199
vm: PropTypes.instanceOf(VM)
199200
};
200201
ProjectFetcherComponent.defaultProps = {
201-
assetHost: 'https://assets.scratch.mit.edu',
202-
projectHost: 'https://projects.scratch.mit.edu'
202+
assetHost: API_HOST + '/API/assets',
203+
projectHost: API_HOST + '/API/projects',
203204
};
204205

205206
const mapStateToProps = state => ({

‎src/lib/storage.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Storage extends ScratchStorage {
5555
this.assetHost = assetHost;
5656
}
5757
getAssetGetConfig (asset) {
58-
return `${this.assetHost}/internalapi/asset/${asset.assetId}.${asset.dataFormat}/get/`;
58+
return `${this.assetHost}/${asset.assetId}.${asset.dataFormat}`;
5959
}
6060
getAssetCreateConfig (asset) {
6161
return {

‎src/lib/tw-project-meta-fetcher-hoc.jsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ import PropTypes from 'prop-types';
33
import {connect} from 'react-redux';
44
import log from './log';
55

6+
7+
const {API_HOST} = require('./brand');
8+
69
import {setProjectTitle} from '../reducers/project-title';
710
import {setAuthor, setDescription} from '../reducers/tw';
811

912
export const fetchProjectMeta = async projectId => {
1013
const urls = [
11-
`https://trampoline.turbowarp.org/api/projects/${projectId}`,
12-
`https://trampoline.turbowarp.xyz/api/projects/${projectId}`
14+
API_HOST+`/API/projectsMETA?${projectId}`,
15+
API_HOST+`/API/projectsMETA?${projectId}`
1316
];
1417
let firstError;
1518
for (const url of urls) {

0 commit comments

Comments
 (0)