project_openai_codex icon indicating copy to clipboard operation
project_openai_codex copied to clipboard

Small edit in script.js

Open brown7477 opened this issue 3 years ago • 2 comments

Change this in project_openai_codex/blob/main/client/script.js

const response = await fetch('https://codex-im0y.onrender.com/', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt: data.get('prompt') }) })

To this // Change 'http://localhost:5000' to your host address const response = await fetch('http://localhost:5000/', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt: data.get('prompt') }) })

I was getting errors and noticed it was calling a wrong OpenAI API than my own. After changing it to the localhost address it was working great.

brown7477 avatar Jan 04 '23 03:01 brown7477

Its not working :(

Thatsgaurav avatar Jan 05 '23 20:01 Thatsgaurav

incase your .env file is outside the Server folder then take it inside it then it will work properly

aditimahabole avatar Jan 07 '23 11:01 aditimahabole