Using class-validator DTO also in front-end

Viewed 2030
1 Answers

We had exactly the same need a couple of months ago with a NestJS backend and Angular frontend. What we've done is to create a third project called "API-Common" using NestJS where we've gathered all the common DTOs and utilities that are needed in both the backend and frontend. To share it, we create an NPM package from the project so we can import it in both applications.

You can learn more about creating your private NPM registry in the following link:

https://gemfury.com/help/npm-registry/

Related