I'm developing Angular 4 application and it has elements of coding quiz, so there is an input field, where the user types in a little bit of code.
The task is to write express Get and Post requests
So, he should write something like this:
app.post('/test', function (req, res) {
const body = req.body.Body
res.set('Content-Type', 'text/plain')
res.send(`You sent: ${body} to Express`)
})
As player typed in request and press the send button, I would like to pass it to my backend and run it there as part of code ( so, the real request would be done with help of code, which user wrote) and then send the answer back to user...I suggest, it could be send as file and then the function could be taken from there...is something like this possible?