@cloud-cli/cli
Version:
CLI for the Cloud CLI project
24 lines (23 loc) • 831 B
TypeScript
/// <reference types="node" />
import { IncomingMessage, Server, ServerResponse } from 'node:http';
import { CloudCommands } from './cloud-commands.js';
import { Settings } from './configuration.js';
export interface ServerParams {
run(command: string, args?: any): any;
}
export declare class HttpServer {
private commands;
private settings;
constructor(commands: CloudCommands, settings: Settings);
handleRequest(request: IncomingMessage & {
body?: any;
}, response: ServerResponse): Promise<void>;
run(name: string, args: any): Promise<any>;
start(): Promise<Server<typeof IncomingMessage, typeof ServerResponse>>;
private getAvailableCommands;
private writeAvailableCommands;
private parseBody;
private isValidCommand;
private serverParams;
private runCommand;
}