Is it possible to change the database connection in sequelize
depending on the route?
For example, Users have access to 2 different installations in a website:
- example.com/foo
- example.com/bar
Upon login users are redirected to example.com/foo
To get all their tasks for the foo
site, they need to visit example.com/foo/tasks
The bar
site uses a separate database and thus if they want to get all their tasks for bar
they have to go to example.com/bar/tasks
Every installation has its own database, and all databases have the same schema.
Is it possible to change the database connection depending on which route is visited?
*login only occurs once