How can I share mongoose models between 2 apps?

后端 未结 6 520
不思量自难忘°
不思量自难忘° 2021-02-04 06:26

I have 2 apps, each in a different folder and they need to share the same models.

I want to symlink the models folder from app A to a models folder in app B.

I\'

6条回答
  •  野的像风
    2021-02-04 07:04

    What I ended up doing here was importing app1 as a submodule (with Git) in app2. This way the models can be imported as normal and are tied to the app's default mongoose connection.

提交回复
热议问题