完成http、https修改

This commit is contained in:
2026-05-17 22:07:07 +08:00
parent 7ff53c2cfd
commit a8ceb194f6
5 changed files with 38 additions and 20 deletions

View File

@@ -22,7 +22,13 @@ export const createServer = (config: Options): express.Express => {
app.use(cors({origin: '*'}));
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.get('/config', (req, res) => res.json({ useWebSocket: config.type == 'websocket', startupMode: config.mode, logging: config.logging }));
app.get('/config', (req, res) => res.json({
useWebSocket: config.type == 'websocket',
startupMode: config.mode,
logging: config.logging,
protocol: config.secure ? 'https' : 'http',
port: config.port
}));
app.use('/signaling', signaling);
app.use(express.static(path.join(__dirname, '../client/public')));
app.use('/module', express.static(path.join(__dirname, '../client/src')));