Getting 405 Method not allowed when connecting to LangServe
krlng opened this issue · 2 comments
I am very unexpierienced with building react frontends, so forgive me if this is an error on my side.
I setup an langserve server using this code: https://github.com/langchain-ai/langserve/blob/main/examples/agent_custom_streaming/server.py
When I connect the AiChat to a locally run server, the server returns
"OPTIONS /stream HTTP/1.1" 405 Method Not Allowed
The normal POST route on the server does work. Using most recent langserve 0.2.2 as well as a freshly installed nlux.
Hey @krlng,
OPTIONS reqeust method is usually sent by the browser as way to verify if the resource is accessbile from different origin, hence it is mostly a CORS problem, can you kindly try to enable CORS and see if it resolves your issues.
Here's some resources:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS#preflighted_requests_in_cors
if you still have same problem i will happily check with you and we can figure it out
Thanks you very much for the answer. To be honest, after some evaluation we settled on building the Chat Interface ourself. So I will close the issue here.