May 2018
Intermediate to advanced
492 pages
12h 3m
English
Sequelize supports the same API on several SQL database engines. The database connection is initialized using parameters on the Sequelize constructor. The Twelve Factor Application model suggests that configuration data such as this should be kept outside the code and injected using environment variables or a similar mechanism. What we'll do is use a YAML-formatted file to store the connection parameters, specifying the filename with an environment variable.
The Sequelize library does not define any such file for storing connection parameters. But it's simple enough to develop such a file. Let's do so.
The API for the Sequelize constructor is: constructor(database: String, username: String, password: ...
Read now
Unlock full access