Share code between a React Frontend and Node.js Backend Application in Nx

Share this video with your friends

Send Tweet

As we have seen, an Nx workspace isn't only for frontend applications, but it can also host backend applications as well. By having the corresponding backend layer within the same monorepo, we can benefit from the code-sharing capabilities in an even greater way. In this lesson, we're going to define a TypeScript interface that describes the data exposed by our backend API. We host that interface in an Nx workspace library, s.t. we can use it from within our Node.js backend application as well as our React frontend app.