Skip to content

Commit 9307adf

Browse files
committed
tmp
1 parent c003bf6 commit 9307adf

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/config.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ export const RUNTIME_CONFIG = { ...getConfigFromElement(currentScript) };
1212
*/
1313
export const API_URLS = {
1414
server: (RUNTIME_CONFIG.server || __WEBDEMO_URL__).replace(/\/$/, ''),
15-
composeServer: (
16-
__WEBDEMO_URL__ || 'https://compose.sandbox.intellij.net'
17-
).replace(/\/$/, ''),
18-
composeResources: (
19-
__WEBDEMO_RESOURCES_URL__ || 'https://compose.sandbox.intellij.net'
20-
).replace(/\/$/, ''),
15+
composeServer: 'https://compose-stage.sandbox.intellij.net'.replace(
16+
/\/$/,
17+
'',
18+
),
2119

2220
COMPILE(platform, version) {
2321
let url;
@@ -69,16 +67,16 @@ export const API_URLS = {
6967
return `${this.composeServer}/api/resource/compose-wasm-versions`;
7068
},
7169
SKIKO_MJS(version) {
72-
return `${this.composeResources}/api/resource/skiko-${version}.mjs`;
70+
return `${this.composeServer}/api/resource/skiko-${version}.mjs`;
7371
},
7472
SKIKO_WASM(version) {
75-
return `${this.composeResources}/api/resource/skiko-${version}.wasm`;
73+
return `${this.composeServer}/api/resource/skiko-${version}.wasm`;
7674
},
7775
STDLIB_MJS(hash) {
78-
return `${this.composeResources}/api/resource/stdlib-${hash}.mjs`;
76+
return `${this.composeServer}/api/resource/stdlib-${hash}.mjs`;
7977
},
8078
STDLIB_WASM(hash) {
81-
return `${this.composeResources}/api/resource/stdlib-${hash}.wasm`;
79+
return `${this.composeServer}/api/resource/stdlib-${hash}.wasm`;
8280
},
8381
get JQUERY() {
8482
return `https://cdn.jsdelivr.net/npm/jquery@1/dist/jquery.min.js`;

webpack.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module.exports = (params = {}) => {
99
const isServer = process.argv[1].includes('webpack-dev-server');
1010
const libraryName = 'KotlinPlayground';
1111
const webDemoUrl = params.webDemoUrl || 'https://api.kotlinlang.org/';
12-
const webDemoResourcesUrl = params.webDemoResourcesUrl || 'https://api.kotlinlang.org/';
12+
const webDemoResourcesUrl =
13+
params.webDemoResourcesUrl || 'https://api.kotlinlang.org/';
1314
const examplesPath = isServer ? '' : 'examples/';
1415
const pathDist = path.resolve(__dirname, 'dist');
1516

@@ -106,6 +107,13 @@ module.exports = (params = {}) => {
106107
],
107108
devServer: {
108109
static: path.resolve(__dirname, 'src'),
110+
headers: {
111+
'Access-Control-Allow-Origin': '*',
112+
'Access-Control-Allow-Methods':
113+
'GET, POST, PUT, DELETE, PATCH, OPTIONS',
114+
'Access-Control-Allow-Headers':
115+
'X-Requested-With, content-type, Authorization',
116+
},
109117
},
110118
};
111119

0 commit comments

Comments
 (0)