diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dc9d0c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM node:16-alpine +WORKDIR /app +COPY . . +RUN npm i -f +CMD [ "npm", "start" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..583cd6d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3' +services: + server: + build: . + ports: + - 8000:8000 diff --git a/src/pages/EditorPage.jsx b/src/pages/EditorPage.jsx index 2c4e9c2..058c15f 100644 --- a/src/pages/EditorPage.jsx +++ b/src/pages/EditorPage.jsx @@ -26,7 +26,7 @@ function EditorPage() { const [access, setAccess] = useState(false); const [terminal, setTerminal] = useState(false); const [output, setOutput] = useState(""); - const [editorOpen, setEditorOpen] = useState(true); + const [editorOpen, setEditorOpen] = useState(false); const [input, setInput] = useState(""); const [langCode, setLangCode] = useState("52"); const handleChat = (e) => { @@ -115,17 +115,17 @@ function EditorPage() { const element = document.createElement("a"); const file = new Blob([liveCode], { type: 'text/plain' }); element.href = URL.createObjectURL(file); - const options = { - method: 'GET', - url: `https://judge0-ce.p.rapidapi.com/languages/${langCode}`, - headers: { - 'X-RapidAPI-Key': `${process.env.REACT_APP_RAPID_API_KEY}`, - 'X-RapidAPI-Host': 'judge0-ce.p.rapidapi.com' - } - }; + // const options = { + // method: 'GET', + // url: `https://judge0-ce.p.rapidapi.com/languages/${langCode}`, + // headers: { + // 'X-RapidAPI-Key': `${process.env.REACT_APP_RAPID_API_KEY}`, + // 'X-RapidAPI-Host': 'judge0-ce.p.rapidapi.com' + // } + // }; - const res = (await axios.request(options)).data; - element.download = res.source_file; + // const res = (await axios.request(options)).data; + element.download = 'main.txt'; document.body.appendChild(element); element.click(); }; @@ -214,9 +214,9 @@ function EditorPage() { {editorOpen && } { - (clients.length !== 0 && clients[0].username === location.state.username && ) + (clients.length !== 0 && clients[0].username === location.state.username && ) } - + {/* */} {isChatShown && }