judge0 / ide

✨ Simple, free and open-source online code editor.
https://ide.judge0.com
MIT License
818 stars 256 forks source link

How to use with local judge0 API server #51

Closed lucyd42 closed 3 years ago

lucyd42 commented 3 years ago

Hey, Can anyone PLEASE help me figure out how to use local judge0 API (which is successfully running and compiling submissions), I just dont know which URL is to be replaced in the 'ide.js' file. What line do I change this to :https://github.com/judge0/ide/blob/02d9560be8/js/ide.js#L1 so that it uses my localhost instead of sending requests to the api.judge0.com.

I have hosted the ide code in python using simpleHTTP server. I am using "http://secure.localhost/standard" instead of "https://secure.judge0.com/standard"

But it gives me CORS error like so :

Access to XMLHttpRequest at 'http://secure.localhost/standard/submissions?base64_encoded=true&wait=false' from origin 'http://secure.localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

Please help me with this, I have been pulling my hair since days. Regards,

hermanzdosilovic commented 3 years ago

This has been discussed on Discord and has been resolved.

For anybody else:

  1. Read https://github.com/judge0/ide/issues/46#issuecomment-658234842
  2. There is no support for IDE and Judge0 Extra.