mirror of
https://github.com/edumeet/edumeet.git
synced 2026-01-23 10:36:11 +00:00
- added toml config template - app & server README.md files moved under config directories - documentation update (configuration section)
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { configDocs } from '../lib/config/config';
|
|
import { writeFile } from 'fs/promises';
|
|
|
|
function formatJson(data)
|
|
{
|
|
return `\`${data.replace(/\n/g, '')}\``;
|
|
}
|
|
|
|
let data = `#  server configuration properties list:
|
|
|
|
| Name | Description | Format | Default value |
|
|
| :--- | :---------- | :----- | :------------ |
|
|
`;
|
|
|
|
Object.entries(configDocs).forEach((entry: [string, any]) =>
|
|
{
|
|
const [ name, value ] = entry;
|
|
|
|
// escape dynamically created default values
|
|
switch (name)
|
|
{
|
|
case 'mediasoup.webRtcTransport.listenIps':
|
|
value.default = '[ { "ip": "0.0.0.0", "announcedIp": null } ]';
|
|
break;
|
|
case 'mediasoup.numWorkers':
|
|
value.default = '4';
|
|
break;
|
|
}
|
|
|
|
data += `| ${name} | ${value.doc} | ${formatJson(value.format)} | \`${formatJson(value.default)}\` |\n`;
|
|
});
|
|
|
|
data += `
|
|
|
|
---
|
|
|
|
*Document generated with:* \`yarn gen-config-docs\`
|
|
`;
|
|
|
|
writeFile('config/README.md', data).then(() =>
|
|
{
|
|
console.log('done'); // eslint-disable-line
|
|
}, (err) =>
|
|
{
|
|
console.error(`Error writing file: ${err.message}`); // eslint-disable-line
|
|
});
|