R
R
ravshan selimov2021-08-27 10:33:52
Express.js
ravshan selimov, 2021-08-27 10:33:52

How to make the sequelize object global in the project?

Hello.

I'm doing a rest api on express and I want to somehow globally access sequelize.
Project structure

  • Controllers/
  • Middlewares/
  • Services/
  • Models/
  • app.ts


The sequelize object is created in app.ts.
I need to get this object in models from the Models folder for initialization using the model extension

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question