A simple demo how to use the HTTPServer with an SDCard file system

Dependencies:   mbed lwip

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "SDFileSystem.h"
00003 #include "HTTPServer.h"
00004 
00005 HTTPServer http;
00006 LocalFileSystem local("local");
00007 SDFileSystem sd(p5, p6, p7, p13, "sd");
00008 
00009 int main(void) {
00010     http.addHandler(new HTTPRPC());
00011     http.addHandler(new HTTPFileSystemHandler("/", "/local/"));
00012     http.addHandler(new HTTPFileSystemHandler("/sdcard", "/sd/"));
00013     http.bind();
00014 
00015     while(1) {
00016         http.poll();
00017     }
00018 }