NAME
Yote::YapiServer - HTTP server for Yote API
SYNOPSIS
use Yote::YapiServer;
my $server = Yote::YapiServer->new(
port => 5001,
db => { type => 'SQLite', data_dir => 'data' },
root_package => 'Yote::YapiServer::Site',
lib_paths => ['lib'],
endpoint => '/yapi',
);
$server->run;
DESCRIPTION
HTTP server class for the Yote API framework. Handles socket listening, fork-per-connection request handling, and HTTP parsing. Delegates API request processing to Yote::YapiServer::Handler.
CONSTRUCTOR
new(%args)
port - Port to listen on (default: 5001)
db - Database config hash (see below)
root_package - Root database object class (default: 'Yote::YapiServer::Site')
lib_paths - Array of lib paths for table discovery
endpoint - API endpoint path (default: '/yapi')
db keys:
type - 'SQLite' or 'MariaDB' (default: 'SQLite')
data_dir - Directory for SQLite files (default: 'data')
dbname - MariaDB database name
username - MariaDB username
password - MariaDB password
METHODS
run()
Starts the HTTP server. Initializes the database, opens the store, and enters the accept loop.
handle_request($conn, $store, $endpoint)
Handles a single HTTP request on the given connection.