Use express-session-level

This commit is contained in:
Wingysam 2018-11-22 18:42:19 -05:00
parent 17df6e29b1
commit d6b4a0f32d
6 changed files with 204 additions and 7 deletions

13
config/secret/index.js Normal file
View file

@ -0,0 +1,13 @@
const uuid = require('uuid/v4');
const path = require('path');
const fs = require('fs');
const secretFilePath = path.join(__dirname, 'secret.txt');
try {
module.exports = fs.readFileSync(secretFilePath).toString();
} catch (_) {
const secret = uuid();
fs.writeFileSync(secretFilePath, secret);
module.exports = secret;
}