/*
 * main.c - WebSocket server entry point.
 */

#include "log.h"
#include "server.h"

#include <getopt.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>

static struct server g_server;

int main(int argc, char *argv[])
{
	if (server_init(&g_server, WSD_DEFAULT_PORT) < 0)
		return EXIT_FAILURE;

	server_run(&g_server);
	server_cleanup(&g_server);

	LOG_INFO("Server shut down cleanly");
	return EXIT_SUCCESS;
}
