burger-api
Version:
<div align="center"> <a href="https://burger-api.com"> <img src="https://github.com/user-attachments/assets/0d9b376e-1d89-479a-aa7f-e7ee3c6b2342" alt="BurgerAPI"/> </a> </div>
20 lines (19 loc) • 811 B
TypeScript
import type { HTMLBundle } from 'bun';
import type { ServerOptions, FetchHandler, RequestHandler } from '../types/index';
export declare class Server {
private options;
private server;
/**
* Initializes a new instance of the Server class with the given options.
* @param options - Configuration options for the server.
*/
constructor(options: ServerOptions);
start(routes: Record<string, HTMLBundle | RequestHandler> | undefined, handler: FetchHandler, port: number, cb?: () => void): void;
/**
* Stops the server.
* If the server is currently running, this method will stop the server and
* log a message to the console indicating that the server has been stopped.
* If the server is not running, this method does nothing.
*/
stop(): void;
}