0

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

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

Google for JavaScript interpreter, there are quite a few.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.