https://github.com/saadbazaz/arduino-rest-server
🔌 Create REST APIs on an Arduino Uno!
https://github.com/saadbazaz/arduino-rest-server
arduino-boards cpp internet-of-things microcontroller rest-api rest-server web-framework web-server
Last synced: 9 days ago
JSON representation
🔌 Create REST APIs on an Arduino Uno!
- Host: GitHub
- URL: https://github.com/saadbazaz/arduino-rest-server
- Owner: SaadBazaz
- Created: 2020-10-25T19:04:56.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-17T18:18:54.000Z (almost 4 years ago)
- Last Synced: 2025-04-15T02:18:21.146Z (9 days ago)
- Topics: arduino-boards, cpp, internet-of-things, microcontroller, rest-api, rest-server, web-framework, web-server
- Language: C++
- Homepage:
- Size: 148 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Arduino-Web-Server
Simple, super-compact webserver code for Arduino boards### Features
- Simple routing
- Time-logging from an actual timeserver
- Extracts and parses request body
- CORS Enabled
- Optimized yet easily editable
- Does not consume enough memory to cause instability (Consuming just ~85% Program memory, ~68% SRAM)### Notes
For production, comment all Serial.print statements and it'll save ~20% SRAM compared to uncommented.You can edit the MAXLENGTH_FIRSTLINE preprocessor definition according to your needs. I recommend building very very small routes, preferably 1 character only. This would optimize performance.
You can also remove unnecessary messages being returned to the client. The browser/app should be capable enough to understand the response just with the HTTP response code.
If the Arduino hangs or takes more than 8 seconds, it is automatically rebooted.
Incase of file corruption, please try to delete the files from the SD card.
##### Tested on
Arduino Uno with Ethernet Shield, and a 16GB (overkill) SD card.Have fun! If you're able to optimize this or make it better, please make a Pull Request.