1
This commit is contained in:
22
server/config/database.js
Normal file
22
server/config/database.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
export function get_sequelize_options() {
|
||||
return {
|
||||
host: process.env.MYSQL_HOST || '127.0.0.1',
|
||||
port: Number(process.env.MYSQL_PORT || 3306),
|
||||
username: process.env.MYSQL_USER || 'root',
|
||||
password: process.env.MYSQL_PASSWORD || '',
|
||||
database: process.env.MYSQL_DATABASE || 'ecom_crawl',
|
||||
dialect: 'mysql',
|
||||
logging: false,
|
||||
define: {
|
||||
underscored: true,
|
||||
timestamps: true,
|
||||
createdAt: 'created_at',
|
||||
updatedAt: 'updated_at'
|
||||
},
|
||||
timezone: '+08:00'
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user