We are trying to make a standalone web app (runs in a browser) that connects and calls the Chai APIs. The APIs do return the appropriate CORS headers except for
Access-Control-Allow-Origin which is
'*' (or wildcard) which is not allowed in many browsers including all the common ones. Please refer to image below:
The solution is to set
Access-Control-Allow-Origin to the requester’s host and port which in this case is
Access-Control-Allow-Origin: http://localhost:8081. We have been trying to do this in Ruby by applying these changes:
to proxy the APIs to the realtime program but we seem to not be able to make any modifications to the Ruby code on the Chai without it failing to start up again.
Steps we took:
- Make Ruby code change on Chai (any change to the file including only a comment will do it)
systemctl start unicorn.serviceto restart service
- Service refuses to start up. Nothing useful in
Are we missing any steps here? We’re not Ruby/Rails programmers so if there are build steps we are missing please let us know!