Home > Blockchain >  How to implement REST API with Angular Universal
How to implement REST API with Angular Universal

Time:12-13

When angular bundle the server files throw me warnings "Warning: Module not found: Error: Can't resolve 'kerberos'" and other modules from mongodb. That happen when i install mongoose and try to connect with a db. The application work, but i don't know how to get rid of this errors.

Tried to import "mongoose" like that "const mongoose = require("mongoose")" but the warnings are still here.

CodePudding user response:

First of all Angular is a Frontend Framework. What does Angular Universal do? It render the first instance of your app on server side. This means not you can handle backend code like mongoose and so on. This part sit on you backend (like NodeJS, PHP and so on).

Short: Mongoose is not for frontend and you should never use it inside frontend! (Security risk)

  • Related