Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 /* Program Example: 12.10 mbed file server setup 00002 */ 00003 #include "mbed.h" 00004 #include "EthernetNetIf.h" 00005 #include "HTTPServer.h" 00006 LocalFileSystem fs("webfs"); 00007 EthernetNetIf eth( 00008 IpAddr(192,168,0,101), //IP Address 00009 IpAddr(255,255,255,0), //Network Mask 00010 IpAddr(192,168,0,1), //Gateway 00011 IpAddr(192,168,0,1) //DNS 00012 ); 00013 HTTPServer svr; 00014 int main() { 00015 eth.setup(); 00016 FSHandler::mount("/webfs", "/"); //Mount webfs path on root path 00017 svr.addHandler<FSHandler>("/"); //Default handler 00018 svr.bind(80); 00019 while(1) 00020 { 00021 Net::poll(); // poll for internet data exchange requests 00022 } 00023 } 00024
Generated on Sat Aug 6 2022 11:22:22 by
1.7.2