initial commit
This commit is contained in:
20
config/database.js
Normal file
20
config/database.js
Normal file
@@ -0,0 +1,20 @@
|
||||
var { Sequelize } = require("sequelize");
|
||||
var sequelize = new Sequelize({
|
||||
dialect: "sqlite",
|
||||
storage: "./storage/database.sqlite3",
|
||||
logging: false
|
||||
});
|
||||
|
||||
async function testConnection() {
|
||||
try {
|
||||
await sequelize.authenticate();
|
||||
console.log("Connection established");
|
||||
} catch (error) {
|
||||
console.error("Unable to connect", error);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
testConnection,
|
||||
sequelize
|
||||
};
|
||||
8
config/sqlite.js
Normal file
8
config/sqlite.js
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
development: {
|
||||
force: true,
|
||||
},
|
||||
production: {
|
||||
force: false,
|
||||
},
|
||||
};
|
||||
16
config/winston.js
Normal file
16
config/winston.js
Normal file
@@ -0,0 +1,16 @@
|
||||
var winston = require("winston");
|
||||
var expressWinston = require("express-winston");
|
||||
|
||||
var requestLogger = expressWinston.logger({
|
||||
transports: [
|
||||
new winston.transports.Console()
|
||||
],
|
||||
format: winston.format.simple(),
|
||||
expressFormat: true,
|
||||
meta: false,
|
||||
colorize: true,
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
requestLogger
|
||||
};
|
||||
Reference in New Issue
Block a user