I need to know how is the best way to solve the problem below:
I have an online editor, where the user write a js code to solve some problem, like a challenge. So, I need to get this code, and proccess it in a server, to check if the code was written correctly, comparing the results.
Do I need to call a js shell in server side or something like this?
2 Answers 2
Running any code written by the user on your server would be a great security issue.
Instead, run the code on the client with eval(). Then send the result (like if the user solved it) to your server.
Comments
Google for JavaScript interpreter, there are quite a few.