Prerender.io search engine optimization deployed to Windows services to enable automatic start-up service

Source: Internet
Author: User
Tags install node node server

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.