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
- Committer:
- robt
- Date:
- 2013-06-16
- Revision:
- 0:4a5bf258d7dd
File content as of revision 0:4a5bf258d7dd:
/* Program Example: 12.10 mbed file server setup
*/
#include "mbed.h"
#include "EthernetNetIf.h"
#include "HTTPServer.h"
LocalFileSystem fs("webfs");
EthernetNetIf eth(
IpAddr(192,168,0,101), //IP Address
IpAddr(255,255,255,0), //Network Mask
IpAddr(192,168,0,1), //Gateway
IpAddr(192,168,0,1) //DNS
);
HTTPServer svr;
int main() {
eth.setup();
FSHandler::mount("/webfs", "/"); //Mount webfs path on root path
svr.addHandler<FSHandler>("/"); //Default handler
svr.bind(80);
while(1)
{
Net::poll(); // poll for internet data exchange requests
}
}