initial commit

This commit is contained in:
Brian Emilius
2020-05-17 22:00:53 +02:00
commit a60a37f441
57 changed files with 902 additions and 0 deletions

20
config/database.js Normal file
View 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
View File

@@ -0,0 +1,8 @@
module.exports = {
development: {
force: true,
},
production: {
force: false,
},
};

16
config/winston.js Normal file
View 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
};