Problem that invoke the API
Closed this issue · 2 comments
Well, today I deploy this web UI on my server, however, I found that I cannot connect the API, in other words, I can open the PandoraAI web and prompt something but I cannot get response. And then I try to modify many settings, including disable firewall, chmod 777 to node-chatgpt-api and PandoraAI, all of above didn't work. By the way, this server is remote server. I set a port for node-chatgpt-api such as 3000 and here are my part settings:
port: process.env.API_PORT || 3000,
host: process.env.API_HOST || 'localhost',
Then, I change my pandoraAI .env file:
API_BASE_URL=http://localhost:3000
Next, I used "npm run server" start node-chatgpt-api and used "npm run dev" start PandoraAI, I ensure both of them successfully started and it shows that the web UI deployed on 3001 port. Well, I also allow this port (3001) can be connected by other networks.
Finally, I can access this web but when I prompt, it didn't response. I tried many settings, but it still didn't work.
Then I tried a very dangerous setting, I modified settings.js file to:
port: process.env.API_PORT || 3000,
host: process.env.API_HOST || '::',
Also, the .env file:
API_BASE_URL=http://mydomain:3000, and here "mydomain" also can be replaced with public address.
If I just modified setting.js and keep the .env on API_BASE_URL=http://localhost:3000, it wouldn't work.
But I think the design is supposed to let the PandoraAI invoke the API locally, for example, I can remotely connect the web UI, and when I prompt, it use the API locally, and pass the response to the UI. Does anyone have the same problem?
I also deploy it on my windows computer (local), it can normally work. So I figure if the remote component has some problems.
I rethink this problem, the main point is that this web UI cannot invoke local API. With regard to the fact that I can invoke using mydomain:3000 in web UI config, it just ensure the web UI can normally work.