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.
Dependencies: mbed-rtos EthernetInterface FatFileSystemCpp MCP23S17 SDFileSystem mbed
Fork of HTTPServerHelloWorld by
Services/Network/RestApiServer/RestServer.cpp@10:372c882b5533, 2014-03-02 (annotated)
- Committer:
- wyunreal
- Date:
- Sun Mar 02 18:15:47 2014 +0000
- Revision:
- 10:372c882b5533
- Parent:
- 8:3655e9a98f28
integrating microchip io expander
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| wyunreal | 6:b2c4687b421d | 1 | #include "RestServer.h" |
| wyunreal | 6:b2c4687b421d | 2 | |
| wyunreal | 6:b2c4687b421d | 3 | RestServer::RestServer(FileSystemLike* aAppSourceFileSystem, FileSystemLike* aLogsFileSystem) { |
| wyunreal | 6:b2c4687b421d | 4 | appSourceFileSystem = aAppSourceFileSystem; |
| wyunreal | 6:b2c4687b421d | 5 | logsFileSystem = aLogsFileSystem; |
| wyunreal | 8:3655e9a98f28 | 6 | |
| wyunreal | 8:3655e9a98f28 | 7 | string sourceFileSystemName(appSourceFileSystem->name()); |
| wyunreal | 8:3655e9a98f28 | 8 | string logsFileSystemName(logsFileSystem->name()); |
| wyunreal | 8:3655e9a98f28 | 9 | |
| wyunreal | 6:b2c4687b421d | 10 | webServer = new HTTPServer(); |
| wyunreal | 6:b2c4687b421d | 11 | webServer->addHandler<SimpleHandler>("/testService"); |
| wyunreal | 8:3655e9a98f28 | 12 | FSHandler::mount("/"+sourceFileSystemName, "/sources"); |
| wyunreal | 8:3655e9a98f28 | 13 | FSHandler::mount("/"+logsFileSystemName, "/logs"); |
| wyunreal | 6:b2c4687b421d | 14 | webServer->addHandler<FSHandler>("/sources"); |
| wyunreal | 6:b2c4687b421d | 15 | webServer->addHandler<FSHandler>("/logs"); |
| wyunreal | 6:b2c4687b421d | 16 | } |
| wyunreal | 6:b2c4687b421d | 17 | |
| wyunreal | 6:b2c4687b421d | 18 | RestServer::~RestServer() { |
| wyunreal | 6:b2c4687b421d | 19 | delete webServer; |
| wyunreal | 6:b2c4687b421d | 20 | } |
| wyunreal | 6:b2c4687b421d | 21 | |
| wyunreal | 6:b2c4687b421d | 22 | void RestServer::bind() { |
| wyunreal | 6:b2c4687b421d | 23 | webServer->bind(80); |
| wyunreal | 6:b2c4687b421d | 24 | } |
