Add HTTP server mode with native node:http
Reintroduce server mode (removed in 3014cf9) using node:http instead of
Express — zero new dependencies. Accepts JSON commands via POST to /,
returns JSON responses with CORS support. Screenshot command returns
base64 data when no path is specified.
- Add src/server.ts with BrowserServer class using node:http
- Add -s/--server <port> CLI flag (default 13373)
- Export BrowserServer and startServer from index.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vendored
+1
-5
@@ -4,17 +4,13 @@ export interface ServerOptions extends BrowserOptions {
|
||||
}
|
||||
export declare class BrowserServer {
|
||||
private browser;
|
||||
private app;
|
||||
private server;
|
||||
private port;
|
||||
constructor(options?: ServerOptions);
|
||||
private setupMiddleware;
|
||||
private setupRoutes;
|
||||
private handleCommand;
|
||||
private handleRequest;
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
getPort(): number;
|
||||
getApp(): import("express-serve-static-core").Express;
|
||||
}
|
||||
export declare function startServer(options?: ServerOptions): Promise<BrowserServer>;
|
||||
//# sourceMappingURL=server.d.ts.map
|
||||
Reference in New Issue
Block a user