Rocket.Chat version: 0.58.0
Anyway, I am trying to make an API call from the browser. It sends an OPTIONS request before POST to /api/logon to check CORS. The thing is, I am getting 500 Internal Server Error on this OPTIONS request, which is rendering Rocket Chat impossible to access from the browser.
This is an option in the library we are using (restivus) and it's disabled.
We can create an option to enable it on admin panel.

I set "Enable CORS" in General Option tab of admin account, but still getting 500 errors
I use Docker compose to run RocketChat
Hello, is there any further feedback on this? I am also receiving a 500 Internal Server Error when hitting the REST API through a browser as it sends the OPTIONS request first.
Hi @ramdesh, Have you solve your problem ? I got the same here.
@huynhquocmy, no - it seems it requires a code change on the server itself. I overcame this problem by implementing a node.js based middleware that routes requests from the UI to the chat server.
Thanks @ramdesh , I solved problem already.
I workaround by changed RocketChat.API.v1 = new API({
version: 'v1',
useDefaultAuth: true,
prettyJson: true,
enableCors: true,
auth: getUserAuth()
});
RocketChat.API.default = new API({
useDefaultAuth: true,
prettyJson: true,
enableCors: true,
auth: getUserAuth()
});
manually set enableCors: true from the file
packages\rocketchat-api\server\api.js
Most helpful comment
I set "Enable CORS" in General Option tab of admin account, but still getting 500 errors
I use Docker compose to run RocketChat