Prerender.io deployment steps for a service-side deployment Reference website:
$ git clone https://github.com/prerender/prerender.git $ cd PreRender $ CNPM Install $ node server.js
In the browser input http://localhost:3000/http://localhost:4200 if you can render your angular project correctly and see that the source code is rendered HTML, the deployment is successful. Second, the Prerender.io service creates the window service, realizes the start-up using the official boot program opens a command window, if the manager accidentally closes this window, or the server restarts, then this service will be invalid, so we need to establish a Windows service for this service, Easy to manage solution for reference 73483631: to PreRender's home directory 1.
CNPM Install Node-windows--save
2. Create the Nw.js code in the root directory
Let Service = require (' Node-windows '). Service;let svc = new Service ({name: ' node_test ',//Service Name Description: ' Test Project Server ',//Description script: ' D:\\projects\\ng\\ Prerender\\server.js '//nodejs project to start file path}); Svc.on (' Install ', () = {Svc.start ();}); Svc.install ();
Run the Run command into the root directory
Node Nw.js
There is no hint that the service installation successfully opened the service management interface to find node_test this service, if not started, manually start it, and set the startup mode to self-boot. At this time again in the browser input http://localhost:3000/http://localhost:4200 accept to put back the results and render successfully, indicating that the service has been started
Prerender.io search engine optimization deployed to Windows services to enable automatic start-up service