Henry Leinen / Mbed 2 deprecated MultiThreadingHTTPServer

Dependencies:   WiFlyHTTPServer WiflyInterface mbed-rpc mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "HttpServer.h"
00003 #include "FsHandler.h"
00004 #include "LocalFileSystem.h"
00005 
00006 DigitalOut myled(LED1);
00007 
00008 Serial pc(USBTX, USBRX, "pc");
00009 
00010 static LocalFileSystem  local("local");
00011 
00012 
00013 int main() {
00014     pc.baud(460800);
00015 
00016     HTTPFsRequestHandler::mount("/local/", "/");
00017        
00018     HttpServer  svr(p9, p10, p30, p29, "Spawnpoint", "Quantenoptik1", WPA);
00019     
00020     svr.addHandler<HTTPFsRequestHandler>("/");
00021     //  Start the server
00022     if (!svr.start(80) ) {
00023         error("SERVER FAILED TO START");
00024     }
00025     
00026     while(1) {
00027         myled = 1;
00028         wait(0.2);
00029         myled = 0;
00030         wait(0.2);
00031     }
00032 }