chore(cli): export defaultConfigFile + add JSDoc

This commit is contained in:
Joe Previte 2021-09-28 15:38:59 -07:00
parent 82d93186f8
commit fb2625dbe8
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24
1 changed files with 11 additions and 1 deletions

View File

@ -502,7 +502,17 @@ export async function setDefaults(cliArgs: Args, configArgs?: ConfigArgs): Promi
} as DefaultedArgs // TODO: Technically no guarantee this is fulfilled. } as DefaultedArgs // TODO: Technically no guarantee this is fulfilled.
} }
async function defaultConfigFile(): Promise<string> { /**
* Helper function to return the default config file.
*
* @returns The default config file:
*
* - bind-addr: 127.0.0.1:8080
* - auth: password
* - password: <generated-password>
* - cert: false
*/
export async function defaultConfigFile(): Promise<string> {
return `bind-addr: 127.0.0.1:8080 return `bind-addr: 127.0.0.1:8080
auth: password auth: password
password: ${await generatePassword()} password: ${await generatePassword()}