Refactor configuration and API; added endpoints for image, video, and news.
This commit is contained in:
29 files changed
+2867
-490
No files matched your search
+6
-6
@@ -1,28 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
import { getOptions } from "./config.js";
|
||||
import { stdioServer, httpServer } from "./protocols/index.js";
|
||||
import { getOptions } from './config.js';
|
||||
import { stdioServer, httpServer } from './protocols/index.js';
|
||||
|
||||
async function main() {
|
||||
const options = getOptions();
|
||||
|
||||
if (!options) {
|
||||
console.error("Invalid configuration");
|
||||
console.error('Invalid configuration');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// default to http server
|
||||
if (!options.transport || options.transport === "http") {
|
||||
if (!options.transport || options.transport === 'http') {
|
||||
httpServer.start();
|
||||
return;
|
||||
}
|
||||
|
||||
// stdio requires explicit request
|
||||
if (options.transport === "stdio") {
|
||||
if (options.transport === 'stdio') {
|
||||
await stdioServer.start();
|
||||
return;
|
||||
}
|
||||
|
||||
console.error("Invalid transport");
|
||||
console.error('Invalid transport');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user