E
E
Evgeny Glebov2021-01-18 16:04:45
JavaScript
Evgeny Glebov, 2021-01-18 16:04:45

Is it possible to execute browser code on the server?

There is a site that makes requests to the server and, based on the data received, draws a chart on the canvas.
Now the user can press the button and the browser will give him a jpg converted from canvas

Question.
Is it possible to make it so that the user can get jpg without even going to the site? Only having url? (for example, he wants to insert a picture into a Word by url)

So far I see this option: write an additional application on the server (based on webkit or the like) that, upon request, will open a page and generate a picture. Then transfer this picture to the web service. And the web service will already give a response.

Perhaps there are some other options, how to run this js code on the server? Maybe somehow through nodejs? Can it work with dom+canvas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LEXA_JA, 2021-01-18
@GLeBaTi

Liba for the node on the first request in Google .
You can also try something with dataUrl
Well, yes, a hardcore variant, launch the browser through puppeteer or playwright

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question