diff --git a/backend/server/src/index.ts b/backend/server/src/index.ts index 9a2ac0d..4463d2e 100644 --- a/backend/server/src/index.ts +++ b/backend/server/src/index.ts @@ -158,7 +158,7 @@ io.on("connection", async (socket) => { console.log("Created container ", data.sandboxId); io.emit( "previewURL", - "https://" + containers[data.sandboxId].getHostname(5173) + "https://" + containers[data.sandboxId].getHostname(3000) ); } } catch (e: any) { diff --git a/backend/storage/src/startercode.ts b/backend/storage/src/startercode.ts index 3979f9b..ae768e1 100644 --- a/backend/storage/src/startercode.ts +++ b/backend/storage/src/startercode.ts @@ -21,49 +21,49 @@ const startercode = { { name: "package.json", body: `{ - "name": "react", + "name": "react-app", + "version": "0.1.0", "private": true, - "version": "0.0.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" - }, "dependencies": { "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "react-scripts": "5.0.1" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] }, "devDependencies": { "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", - "@vitejs/plugin-react": "^4.2.1", "eslint": "^8.57.0", "eslint-plugin-react": "^7.34.1", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.6", - "vite": "^5.2.0" + "eslint-plugin-react-hooks": "^4.6.0" } }`, }, { - name: "vite.config.js", - body: `import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], - server: { - port: 5173, - host: "0.0.0.0", - } -}) -`, - }, - { - name: "index.html", + name: "public/index.html", body: ` @@ -133,7 +133,7 @@ export default App `, }, { - name: "src/main.jsx", + name: "src/index.js", body: `import React from 'react' import ReactDOM from 'react-dom/client' import App from './App.jsx'