2022-04-04 11:36:55 +02:00

21 lines
515 B
JavaScript

'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const _ = require('lodash');
module.exports = ({ useTypescript }) => {
// resolve ts or js version depending on project type
const language = useTypescript ? 'ts' : 'js';
const tmpl = fs.readFileSync(path.join(__dirname, language, `admin-config.template`));
const compile = _.template(tmpl);
return compile({
adminJwtToken: crypto.randomBytes(16).toString('hex'),
useTypescript,
});
};