Open blombergniklas opened 4 years ago
Same here. How about adding admin panel as microservice?
Is this related to #7? I was able to overcome similar auth issues by using the approach outlined in https://github.com/SoftwareBrothers/admin-bro-nestjs/issues/7#issuecomment-743963341
@maxpeterson its working for me also with your setup. Thanks!
you must add app.use(express.json()); to index.js
node:internal/modules/esm/resolve:257 admin-dashboard | throw new ERR_MODULE_NOT_FOUND( admin-dashboard | ^ admin-dashboard | admin-dashboard | Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/dist/app.module' imported from /app/dist/main.js admin-dashboard | at finalizeResolution (node:internal/modules/esm/resolve:257:11) admin-dashboard | at moduleResolve (node:internal/modules/esm/resolve:914:10) admin-dashboard | at defaultResolve (node:internal/modules/esm/resolve:1038:11) admin-dashboard | at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12) admin-dashboard | at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25) admin-dashboard | at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38) admin-dashboard | at ModuleJob._link (node:internal/modules/esm/module_job:126:49) { admin-dashboard | code: 'ERR_MODULE_NOT_FOUND', admin-dashboard | url: 'file:///app/dist/app.module' admin-dashboard | }
Backend api built with nestjs serves call at
/
, endpoints looks like/users/me
or/auth/login
etc. Before adding AdminBro, call to/auth/login
with post body of{"email": "<some-email>", "password": "<some-password>" }
works fine. But when adding a module named Backoffice to my app.module.ts post body is not found when calling/auth/login
and throws an exception in the controller. All calls to AdminBro works fine under/admin
package.json dependencies used:
I've narrowed it down to ExpressLoader in this repo which moves jsonParser and urlencodeparser in layer stack below AdminBro router. Commenting this out breaks AdminBro but nestjs api works again.