Skip to content

local database doesn't work #63

@m4v15

Description

@m4v15

This isn't a big deal, but something that might be useful to know:

This line, in sequilize.js which you need to make the remote DB work, stops a local DB from working:

  dialectOptions: {
    ssl: true,
  },

There are a few ways around it, a simple one is having it depend on an environment variable, eg:

dialectOptions: {
  ssl: !process.env.USE_LOCAL_DB,
},

Then if someone wants to use a local database, they just make sure they have a variable called USE_LOCAL_DB in their env file. On Heroku, or wherever you want to use a hosted DB, this variable should not exist so then the statement ssl: !process.env.USE_LOCAL_DB evaluates to ssl:true as it is now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions