1

I've removed datasources.json and added a datasources.local.js file.

var postgresURI = process.env.DATABASE_URL; module.exports = { db: { defaultForType: 'postgresql', connector: 'postgresql', url: postgresURI } };

In model-config.json I have "dataSource": "db" set for all sections.

It throws the following error: User is referencing a dataSource that does not exist: "db".

I understand the error but not why it's being thrown. What I am doing wrong?

Jordan Kasper
  • 13,153
  • 3
  • 36
  • 55
Lee
  • 1,389
  • 3
  • 18
  • 28

1 Answers1

3

As documentation says:

You can override values set in datasources.json in the following files: datasources.local.js or datasources.local.json

So instead of removing datasources.json you might want to keep it with a declaration of "db" in it. While in "datasources.local.js" you need to override environment specific setting which is the url.

Alex V
  • 1,155
  • 8
  • 10