-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated routes files and added comments throughout
- Loading branch information
1 parent
375b911
commit 3a3b208
Showing
7 changed files
with
164 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
const Sequelize = require('sequelize'); | ||
require('dotenv').config(); | ||
const Sequelize = require('sequelize'); // import sequelize (https://sequelize.org/docs/v6/getting-started/) | ||
require('dotenv').config(); // import dotenv (https://www.npmjs.com/package/dotenv) (https://github.com/sindresorhus/dotenv) | ||
|
||
let sequelize; | ||
let sequelize; // sequelize object (https://sequelize.org/docs/v6/getting-started/) | ||
|
||
if (process.env.JAWSDB_URL) { | ||
sequelize = new Sequelize(process.env.JAWSDB_URL); | ||
} else { | ||
sequelize = new Sequelize( | ||
process.env.DB_NAME, | ||
process.env.DB_USER, | ||
process.env.DB_PASSWORD, | ||
if (process.env.JAWSDB_URL) { // if JAWSDB_URL is defined (https://devcenter.heroku.com/articles/jawsdb) | ||
sequelize = new Sequelize(process.env.JAWSDB_URL); // use JAWSDB_URL (https://devcenter.heroku.com/articles/jawsdb) | ||
} else { // if JAWSDB_URL is not defined (https://devcenter.heroku.com/articles/jawsdb) | ||
sequelize = new Sequelize( // use local database (https://sequelize.org/docs/v6/getting-started/) | ||
process.env.DB_NAME, // database name (https://sequelize.org/docs/v6/getting-started/) | ||
process.env.DB_USER, // database user (https://sequelize.org/docs/v6/getting-started/) | ||
process.env.DB_PASSWORD, // database password (https://sequelize.org/docs/v6/getting-started/) | ||
{ | ||
host: 'localhost', | ||
dialect: 'mysql', | ||
port: 3306 | ||
host: 'localhost', // database host (https://sequelize.org/docs/v6/getting-started/) | ||
dialect: 'mysql', // database dialect (https://sequelize.org/docs/v6/getting-started/) | ||
port: 3306 // database port (https://sequelize.org/docs/v6/getting-started/) | ||
} | ||
); | ||
} | ||
|
||
module.exports = sequelize; | ||
module.exports = sequelize; // export sequelize object (https://sequelize.org/docs/v6/getting-started/) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.