Refactor config loading (completed)
This commit is contained in:
10
src/index.ts
10
src/index.ts
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
import { Logger } from './utils/logger.util.js';
|
||||
import configLoader from './config/config-loader.js';
|
||||
import { runCli } from './cli/index.js';
|
||||
import { stdioTransport } from './server/stdio.js';
|
||||
import { streamableHttpTransport } from './server/streamableHttp.js';
|
||||
|
||||
@@ -43,18 +42,9 @@ export async function startServer(): Promise<void> {
|
||||
* Main entry point
|
||||
*/
|
||||
async function main() {
|
||||
const mainLogger = Logger.forContext('index.ts', 'main');
|
||||
|
||||
// Load configuration
|
||||
configLoader.load();
|
||||
|
||||
// CLI mode - if any arguments are provided
|
||||
if (process.argv.length > 2) {
|
||||
mainLogger.info('CLI mode detected');
|
||||
await runCli(process.argv.slice(2));
|
||||
return;
|
||||
}
|
||||
|
||||
// Server mode - determine transport and start server
|
||||
await startServer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user