Files
old-nasuh/main.c
2022-11-20 07:47:52 +01:00

27 lines
645 B
C

#include <microhttpd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "handlers.h"
int main(int argc,
char ** argv) {
struct MHD_Daemon * d;
if (argc != 2) {
printf("%s PORT\n",
argv[0]);
return 1;
}
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION,
atoi(argv[1]),
NULL,
NULL,
&handle_all,
NULL,
MHD_OPTION_END);
if (d == NULL)
return 1;
(void) getc (stdin);
MHD_stop_daemon(d);
return 0;
}