A http client sample program.

Dependencies:   NyFileSystems libMiMic mbed-rtos mbed

Fork of TcpSocketClientSamlpe by Ryo Iizuka

Revision:
12:218b57d9a6d4
Parent:
10:80c05810f911
Child:
19:66d729b94d16
--- a/main.cpp	Tue May 14 13:11:55 2013 +0000
+++ b/main.cpp	Thu Jun 20 02:11:11 2013 +0000
@@ -35,7 +35,7 @@
     ModLocalFileSystem modlocal;
     ModLocalFileSystem modsd;
 public:
-    FsHttpd():Httpd(80)
+    FsHttpd(NetConfig& i_cfg):Httpd(i_cfg._inst.services.http_port)
     {
         //bind local file system path to /local/*
         modlocal.setParam("local");
@@ -78,16 +78,19 @@
     }
 };
 
+NetConfig cfg; //create network configulation
+
 int main()
 {
-    NetConfig cfg; //create network configulation
-    Net net(cfg);  //create a net instance.
+    Net net;  //create a net instance.
+
     //try to override setting by local file.
     if(!cfg.loadFromFile("/local/mimic.cfg")){
         wait_ms(1000);
         cfg.loadFromFile("/sd/mimic.cfg");
-    }    
-    FsHttpd httpd; //create a httpd instance.
+    }
+    FsHttpd httpd(cfg); //create a httpd instance.
+    net.start(cfg);
     httpd.loop();  //start httpd loop.
     return 0;
 }