简体   繁体   中英

Is this possible to use a front-end JS Framework on the server side with Node.JS to create a Web service for content delivery?

I have a complete project made with Playcanvas (a JS GameEngine Framework) that uses the HTML canvas tag. This project can also generate images in different format (base64, dataUrl, blob, jpeg).

I want to put this project on the server side to create a new Web service that can deliver images, generated from that Playcanvas project.

So, is this possible to use a functional code from the client-side and put it on the server-side with Node.JS? I know some works like node-canvas that achieve a similar goal.

在此处输入图像描述

You can use puppeteer(headless chrome) to get the full control of a browser on the server side. You can then render the images on the server in required format and can export to the front end.

https://github.com/GoogleChrome/puppeteer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM