Skip to content

Node.js on WPVIP

Node.js applications on WPVIP are provisioned with load-balanced pods with an optional Redis add-on. The WPVIP Platform is designed to run Node.js web applications—including decoupled/headless frontends to WordPress, microservices, REST APIs, GraphQL APIs, and middleware.

Node.js environments can enable New Relic for insights on performance and help with debugging issues.

Limitations

Node.js applications are not eligible for the debugging feature regardless of the contracted pricing plan. This excludes Node.js applications from receiving assistance from WPVIP Support with questions or issues related to application code.

URL path limitations

For security and performance reasons, some paths have special behavior across all applications hosted on WPVIP, even Node.js applications:

  • /wp-admin
  • /wp-content
  • /wp-includes
  • /wp-login

Avoid the use of these paths on Node.js sites. If one of these paths is needed to proxy or redirect a request matching a WordPress site, it should be rewritten. For example, redirect https://nodejs-app.example.com/admin to https://wp-app.example.com/wp-admin/.

Plugins and code examples

A fundamental difference between a WordPress and a Node.js application is the lack of restrictions on the structure of a Node.js application. However, a Node.js application on WPVIP must fulfill several requirements before it can run successfully on WPVIP’s infrastructure.

WordPress VIP has authored a selection of plugins and code examples intended to assist developers at all levels of experience to successfully build Node.js applications with greater confidence and efficiency.

  • Node.js Skeleton: All wpcomvip GitHub repositories created for Node.js applications are initialized with a copy of the vip-go-node-skeleton repository. Developers can opt to work with any framework they prefer for their Node.js applications.
    • In its initial state, the repository of a Node.js application is a useful example for the basic requirements necessary to successfully deploy and run a Node.js application on WPVIP’s infrastructure. Detailed explanations for the basic requirements can be reviewed in the code comments of the entry point /src/index.js.
    • This repository also includes code examples that demonstrate how to use various frameworks and technologies on the WPVIP Platform.
  • Next.js Boilerplate: The Next.js Boilerplate repository is an optional resource for customers who are using the Next.js framework for decoupled WordPress. The code provided in the repository can be helpful for solving many common use cases for decoupled WordPress applications. The Next.js Boilerplate requires that WPVIP’s Decoupled Plugin Bundle is installed and activated on the WordPress backend.
  • Decoupled Plugin Bundle: The Decoupled Plugin Bundle provides a selected group of plugins that are designed to quickly set up a decoupled WordPress application. It is designed to support WPVIP’s Next.js Boilerplate but can be used to support any decoupled frontend. It solves a number of common problems facing decoupled sites, including previewing, permalinks, feeds, and exposing structured data for block-based content.
  • Block Data API plugin: The Block Data API is a REST API for retrieving block editor posts structured as JSON data. While primarily designed for use in decoupled WordPress, the Block Data API plugin can be used anywhere a developer has a need to represent block markup as structured data. For decoupled sites that host the WordPress back end on WPVIP, the Block Data API plugin is already provided and version managed by VIP MU plugins and can be code enabled.

Last updated: August 13, 2024

Relevant to

  • Node.js