Skip to content

Commit f3b560b

Browse files
Merge pull request #1 from CodeSignal/feat/split-screen-side-sim-support
support embedded side-sim mounting
2 parents fe647a0 + 1c2481b commit f3b560b

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dev": "concurrently \"vite --host 0.0.0.0\" \"node server.js\"",
88
"build": "vite build",
99
"start": "IS_PRODUCTION=true node server.js",
10+
"start:prod": "IS_PRODUCTION=true node server.js",
1011
"preview": "npm run build && npm run start"
1112
},
1213
"dependencies": {

src/components/TaskPanelMount.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function TaskPanelMount() {
1515

1616
useEffect(() => {
1717
let active = true;
18-
fetch('/api/task')
18+
fetch('./api/task')
1919
.then((response) => {
2020
if (!response.ok) throw new Error(`task fetch failed: ${response.status}`);
2121
return response.json();
@@ -48,7 +48,7 @@ export function TaskPanelMount() {
4848
config: data.task,
4949
initialAnswer: data.submittedAnswer,
5050
onChange: (answer) => {
51-
fetch('/api/task/answer', {
51+
fetch('./api/task/answer', {
5252
method: 'POST',
5353
headers: { 'Content-Type': 'application/json' },
5454
body: JSON.stringify({ answer }),

src/lib/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let apiAvailable: boolean | null = null;
77

88
export async function fetchConfig(): Promise<GeometryState> {
99
try {
10-
const response = await fetch('/api/config');
10+
const response = await fetch('./api/config');
1111
if (response.status === 404) {
1212
apiAvailable = false;
1313
return readLocalState();
@@ -36,7 +36,7 @@ export async function postState(objects: GeomObject[]): Promise<void> {
3636
}
3737

3838
try {
39-
const response = await fetch('/api/state', {
39+
const response = await fetch('./api/state', {
4040
method: 'POST',
4141
headers: {
4242
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)