Accessing mounted LB3 Models and their datasources in LB4 #9396
-
I'm currently running a middleware that in lb3 would be passed the app as a whole and could access the models with the method app.models.MODEL and then run the built-in create method to create a new document in the DB datasource set. I've attempted to recreate this with a lb4 server with the old lb3 mounted but the app that I'm passing in doesn't have access to the .models method. Below is a code snipped of how I am passing in the app in the old lb3 app and how it is being used.
And here is how I am trying it in the lb4 server.ts file
However the lbApp doesn't have the .models method. Any idea how I can access the mounted models in Lb4? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
you can import the lb3 app, like this and then you can just do |
Beta Was this translation helpful? Give feedback.
you can import the lb3 app, like this
const lb3app = require("../../lb3app/core/app");
, depends on your project structureand then you can just do
lb3app.models.User