//This function adds a Resource Handler for the pages stats.html and formtest.html and associates stats , form and their callback functions void init_dynamic_content() { indexPage=AmmServer_ReadFileToMemory(indexPagePath,&indexPageLength); if (indexPage==0) { AmmServer_Error("Could not find Index Page file %s ",indexPagePath); exit(0); } AmmServer_AddResourceHandler(default_server,&screenContext,"screen.jpg",512000,400,&prepare_screen_content_callback,SAME_PAGE_FOR_ALL_CLIENTS); AmmServer_AddResourceHandler(default_server,&indexPageContext,"/index.html",4096,0,&prepare_index_content_callback,SAME_PAGE_FOR_ALL_CLIENTS); AmmServer_AddResourceHandler(default_server,&commandContext,"/cmd",4096,0,&prepare_command_content_callback,DIFFERENT_PAGE_FOR_EACH_CLIENT); }
//This function adds a Resource Handler for the pages stats.html and formtest.html and associates stats , form and their callback functions void init_dynamic_content() { if (! AmmServer_AddResourceHandler(default_server,&control,"/control.html",webserver_root,4096,0,(void*) &control_callback,SAME_PAGE_FOR_ALL_CLIENTS) ) { AmmServer_Warning("Failed adding stats page\n"); } if (! AmmServer_AddResourceHandler(default_server,&termination,"/terminate.html",webserver_root,4096,0,(void*) &control_callback,SAME_PAGE_FOR_ALL_CLIENTS) ) { AmmServer_Warning("Failed adding stats page\n"); } }
//This function adds a Resource Handler for the pages stats.html and formtest.html and associates stats , form and their callback functions void init_dynamic_content() { AmmServer_AddRequestHandler(default_server,&GET_override,"GET",&request_override_callback); unsigned char* buf = prepare_index_prototype("src/Services/MyBlog/res/index.html",&myblog); if (! AmmServer_AddResourceHandler(default_server,&stats,"/index.html",webserver_root,44096,0,&prepare_index,SAME_PAGE_FOR_ALL_CLIENTS) ) { AmmServer_Warning("Failed adding index page\n"); } if (! AmmServer_AddResourceHandler(default_server,&random_chars,"/random.html",webserver_root,4096,0,&prepare_random_content_callback,DIFFERENT_PAGE_FOR_EACH_CLIENT) ) { AmmServer_Warning("Failed adding random testing page\n"); } }
//This function adds a Resource Handler for the pages stats.html and formtest.html and associates stats , form and their callback functions void init_dynamic_content() { if (! AmmServer_AddResourceHandler(default_server,&searchContext,"/search.html",webserver_root,4096,0,&search_callback,SAME_PAGE_FOR_ALL_CLIENTS) ) { AmmServer_Warning("Failed adding stats page\n"); } if (! AmmServer_AddResourceHandler(default_server,&indexContext,"/index.html",webserver_root,4096,0,&prepare_index_content_callback,SAME_PAGE_FOR_ALL_CLIENTS) ) { AmmServer_Warning("Failed adding stats page\n"); } if (! AmmServer_AddResourceHandler(default_server,&logoContext,"/search.png",webserver_root,4096,0,&prepare_logo_content_callback,DIFFERENT_PAGE_FOR_EACH_CLIENT) ) { AmmServer_Warning("Failed adding random testing page\n"); } if (! AmmServer_AddResourceHandler(default_server,&faviconContext,"/favicon.ico",webserver_root,4096,0,&favicon_callback,DIFFERENT_PAGE_FOR_EACH_CLIENT) ) { AmmServer_Warning("Failed adding random testing page\n"); } }
//This function adds a Resource Handler for the pages stats.html and formtest.html and associates stats , form and their callback functions void init_dynamic_content(char * webroot,char * app_clipart) { char index_file_template[MAX_FILE_PATH]; strcpy(index_file_template,app_clipart); strcat(index_file_template,"/remote_control.html"); index_content = readFileForServing(index_file_template,&index_content_size); if (index_content==0) { fprintf(stderr,"Could not find index page template..\n"); } if (! AmmServer_AddResourceHandler(flashy_server,&index_control, (char *) "/index.html",webroot,4096,0,(void* ) &index_control_page,SAME_PAGE_FOR_ALL_CLIENTS) ) { fprintf(stderr,"Failed adding index page\n"); } AmmServer_DoNOTCacheResourceHandler(flashy_server,&index_control); }
int AmmServer_EnableMonitor( struct AmmServer_Instance * instance) { warning("Enabling Monitor.."); instance->webserverMonitorEnabled=1; return AmmServer_AddResourceHandler ( instance, &instance->webserverMonitorPage, "/monitor.html", instance->webserver_root , 16000, 10, &serveMonitorPage, SAME_PAGE_FOR_ALL_CLIENTS ); }