helloworld
Not logged in

The code for a "Hello, world" program.


#include "stdafx.h"

#include "webem/cWebem.h"

int _tmain(int argc, _TCHAR* argv[])
{
	// write file to display
	FILE * fp =fopen("index.html","w");
	fprintf(fp,"Hello, world" );
	fclose(fp);

	// Initialize web server.
	http::server::cWebem theServer(
		"0.0.0.0",				// address
		"8080",					// port
		".\\");					// document root 

	// tell user where to point browser
	printf("%s",theServer.Splash().c_str());

	// run the server
	theServer.Run();

	return 0;
}

This code and a project to build it, is in the examples folder.

A detailed step by step description of the code can be found in my CodeProject Article