Simplifying database connection options
This commit is contained in:
parent
fcc89e75e6
commit
555ae80afc
@ -2,20 +2,11 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const Sequelize = require('sequelize');
|
const Sequelize = require('sequelize');
|
||||||
const Op = Sequelize.Op
|
const Op = Sequelize.Op
|
||||||
//const request = require('request'); // TEMPORARY! Used for import function.
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// Setup database, using credentials set in .env
|
// Setup database, using credentials set in .env
|
||||||
var sequelize = new Sequelize('database', process.env.DB_USER, process.env.DB_PASS, {
|
var sequelize = new Sequelize('database', process.env.DB_USER, process.env.DB_PASS, {
|
||||||
host: '0.0.0.0',
|
|
||||||
dialect: 'sqlite',
|
dialect: 'sqlite',
|
||||||
pool: {
|
|
||||||
max: 5,
|
|
||||||
min: 0,
|
|
||||||
idle: 10000
|
|
||||||
},
|
|
||||||
// Security note: the database is saved to the file `database.sqlite` on the local filesystem. It's deliberately placed in the `.data` directory
|
|
||||||
// which doesn't get copied if someone remixes the project.
|
|
||||||
storage: '.data/database.sqlite'
|
storage: '.data/database.sqlite'
|
||||||
});
|
});
|
||||||
var Readings;
|
var Readings;
|
||||||
|
Loading…
Reference in New Issue
Block a user