mirror of
https://github.com/filecoffee/filehost.git
synced 2024-11-13 19:49:56 +01:00
19 lines
405 B
JavaScript
19 lines
405 B
JavaScript
const { Sequelize } = require("sequelize");
|
|
require("dotenv").config();
|
|
|
|
let sequelize;
|
|
|
|
if (process.env.DIALECT === "sqlite") {
|
|
sequelize = new Sequelize({
|
|
dialect: "sqlite",
|
|
storage: process.env.SQLITE_STORAGE,
|
|
logging: false,
|
|
});
|
|
} else {
|
|
sequelize = new Sequelize(process.env.DATABASE_URL, {
|
|
dialect: process.env.DIALECT,
|
|
logging: false,
|
|
});
|
|
}
|
|
|
|
module.exports = sequelize;
|