From 4f65f38f0c216f44c4169363839f1213cc5f3c3d Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 30 Aug 2025 14:41:19 +0800 Subject: [PATCH] feat: more opinions in config.ts --- src/config.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index afa99d5..c8f4452 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,8 +1,30 @@ import fs from 'node:fs/promises' import chalk from 'chalk' +const default_data_path = "./thewhitesilk_data" let config = { - data_path: "./thewhitesilk_data" + data_path: default_data_path, + server: { + use: "http", + /** + * used in server.listen() + */ + listen: { + port: 3601, + host: "::", + /** + * setting ipv6Only to true will disable dual-stack support, i.e., binding to host :: won't make 0.0.0.0 be bound. + */ + ipv6Only: false, + }, + /** + * used in https.createServer() + */ + https: { + key: default_data_path + '/key.pem', + cert: default_data_path + '/cert.pem', + }, + }, } try {