Use express-session-level
This commit is contained in:
parent
17df6e29b1
commit
d6b4a0f32d
6 changed files with 204 additions and 7 deletions
13
config/secret/index.js
Normal file
13
config/secret/index.js
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue