Added utils.js

pull/12/head
tycrek 4 years ago
parent 1e61482719
commit 71a0d1cf8c
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -0,0 +1,9 @@
const fs = require('fs-extra');
const Path = require('path');
module.exports = {
log: console.log,
path: (...paths) => Path.join(__dirname, ...paths),
saveData: (data) => fs.writeJsonSync(Path.join(__dirname, 'data.json'), data, { spaces: 4 }),
verify: (req, tokens) => req.headers.authorization && tokens.includes(req.headers.authorization)
}
Loading…
Cancel
Save