ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
16.73k stars 1.56k forks source link

Cannot GET / #445

Closed Tobe2d closed 1 month ago

Tobe2d commented 1 month ago

When I try to open the backend on http://localhost:3001/ I get white page with small text "Cannot GET /" image

Therefore when I try to use the API I am getting error:

An Error occured: 400 Client Error: Bad Request for url: http://host.docker.internal:3001/api/search

the log for the backend in docker looks good:

2024-10-31 00:05:53 yarn run v1.22.19
2024-10-31 00:05:53 $ npm run db:push && node dist/app.js
2024-10-31 00:05:53 
2024-10-31 00:05:53 > perplexica-backend@1.9.1 db:push
2024-10-31 00:05:53 > drizzle-kit push sqlite
2024-10-31 00:05:53 
2024-10-31 00:05:53 drizzle-kit: v0.22.7
2024-10-31 00:05:53 drizzle-orm: v0.31.2
2024-10-31 00:05:53 
2024-10-31 00:05:53 No config path provided, using default path
2024-10-31 00:05:53 Reading config file '/home/perplexica/drizzle.config.ts'
2024-10-31 00:05:54 [⣷] Pulling schema from database...
[✓] Pulling schema from database...
2024-10-31 00:05:54 
2024-10-31 00:05:54 [i] No changes detected
2024-10-31 00:05:54 info: WebSocket server started on port 3001
2024-10-31 00:05:54 info: Server is running on port 3001

However, Perplexica is working fine as frontend when I use it on port 3000

what am I missing?

ItzCrazyKns commented 1 month ago

Use http://localhost:3001/api/search. You don't need to use host.docker.internal since you're sending request from the host.

Tobe2d commented 1 month ago

Thanks for the reply,

Changing it to http://localhost:3001/api/search still give me this result:

image

ItzCrazyKns commented 1 month ago

You need to send a post request, its an API not a GUI.

Tobe2d commented 1 month ago

Yes when I try to make call I egt this:

An Error occured: HTTPConnectionPool(host='localhost', port=3001): Max retries exceeded with url: /api/search (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff0fa55ee10>: Failed to establish a new connection: [Errno 111] Connection refused'))