{"id":13781676,"url":"https://github.com/lasselukkari/aWOT","last_synced_at":"2025-05-11T15:31:57.347Z","repository":{"id":15472534,"uuid":"18205935","full_name":"lasselukkari/aWOT","owner":"lasselukkari","description":"Arduino web server library.","archived":false,"fork":false,"pushed_at":"2025-01-16T17:29:57.000Z","size":51064,"stargazers_count":300,"open_issues_count":6,"forks_count":42,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-18T21:26:22.282Z","etag":null,"topics":["arduino","esp32","esp8266","http","iot","rest","rest-api","web-server"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lasselukkari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-28T08:42:38.000Z","updated_at":"2025-03-07T02:10:23.000Z","dependencies_parsed_at":"2024-01-15T20:55:28.050Z","dependency_job_id":"c78c1bc7-e874-4a61-87d1-17e8fec0c05c","html_url":"https://github.com/lasselukkari/aWOT","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasselukkari%2FaWOT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasselukkari%2FaWOT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasselukkari%2FaWOT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasselukkari%2FaWOT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lasselukkari","download_url":"https://codeload.github.com/lasselukkari/aWOT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253588580,"owners_count":21932280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","esp32","esp8266","http","iot","rest","rest-api","web-server"],"created_at":"2024-08-03T18:01:28.155Z","updated_at":"2025-05-11T15:31:57.310Z","avatar_url":"https://github.com/lasselukkari.png","language":"C++","funding_links":[],"categories":["Libraries","Library"],"sub_categories":["Low Level"],"readme":"aWOT\n==========\n\nArduino web server library.\n\n## Documentation\n#### 1. Getting started\n * [Hello World](https://awot.net/en/starter/hello-world.html)\n * [Basic routing](https://awot.net/en/starter/basic-routing.html)\n * [Application generator](https://awot.net/en/starter/generator.html)\n * [Serving static files](https://awot.net/en/starter/static-files.html)\n#### 2. Guide\n * [Routing](https://awot.net/en/guide/routing.html)\n * [Middleware](https://awot.net/en/guide/middleware.html)\n * [Working with JSON data](https://awot.net/en/guide/json.html)\n * [Tutorial: Deploying a React app on the ESP32](https://awot.net/en/guide/tutorial.html)\n#### 3. API Reference\n * [Application](https://awot.net/en/3x/api.html#app)\n * [Request](https://awot.net/en/3x/api.html#req)\n * [Response](https://awot.net/en/3x/api.html#res)\n * [Router](https://awot.net/en/3x/api.html#router)\n\n## Compatibility\n\nThe aWOT web server library has been designed to work with all Arduino compatible development boards and networking options. This also means that switching the board or changing from WiFi to Ethernet will require minimal changes. The examples directory shows you how to use the library with the most popular Ethernet and WiFi libraries \n\nHowever there are few subtle differences that need to be taken into account. Also unfortunately some of the WiFi and Ethernet libraries have bugs that prevent the library from working properly.\n\nPreviously the library has been tested with:\n- Adafruit Feather M0 WiFi\n- Arduino UNO + WIZnet W5100\n- Arduino Mega + WIZnet W5100\n- Arduino Due + WIZnet W5100\n- Arduino MKR WiFi 1010 (see notes)\n- Teensy 3.0 + WIZnet W5200\n- Teensy 4.1 Ethernet (see notes)\n- ESP32 + Wiznet W5500 Ethernet (see notes)\n- ESP32 + LAN8270 Ethernet\n- ESP32 WiFi\n- ESP8266 WiFi\n\n#### ESP32 and ESP8266 WiFi\n\nIn both of the ESP Arduino cores the WiFiClient closes the connection automatically in the class destructor. This means that the client.stop(), does not need to be explicitly called but you will need to take extra steps if you want to keep the connection alive.\n\n#### ESP32 + Wiznet W5500\nThe current version of the ESP32 Arduino core uses a non standard version of the Server class. Until the ESP32 core is fixed you need to manually modify the begin function in the Server.h if you want to use the Ethernet library that is shipped with the core.\n\nBug report: https://github.com/espressif/arduino-esp32/issues/2704\n\n#### Teensy 4.1 + Ethernet\nThe Teensy 4.1 Ethernet library currently has a bug that causes the connection to stall and reset when connections to the server are opened in fast phase. The bug has been verified but not fixed yet.\n\nBug report: https://github.com/vjmuzik/NativeEthernet/issues/7\n\n#### Arduino UNO\nBecause of the limited RAM and ROM Arduino UNO is on the edge of being usable for anything more complicated. If you want to use this library together with the SD card or any JSON parsing library, pay attention that you do not run out of memory.\n\n## Examples\n### Hello World\n```cpp\n#include \u003cWiFi.h\u003e\n#include \u003caWOT.h\u003e\n\nWiFiServer server(80);\nApplication app;\n\nvoid index(Request \u0026req, Response \u0026res) {\n  res.print(\"Hello World!\");\n}\n\nvoid setup() {\n  Serial.begin(115200);\n\n  WiFi.begin(\"ssid\", \"password\");\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(500);\n    Serial.print(\".\");\n  }\n  Serial.println(WiFi.localIP());\n\n  app.get(\"/\", \u0026index);\n  server.begin();\n}\n\nvoid loop() {  \n  WiFiClient client = server.available();\n\n  if (client.connected()) {\n    app.process(\u0026client);\n    client.stop();\n  }\n}\n```\n\n### Query parameters\n```cpp\n// HTTP GET /cats?type=lolcat\nvoid queryParams(Request \u0026req, Response \u0026res) {\n  char type[64];\n  req.query(\"type\", type, 64);\n\n  res.print(type); // \"lolcat\"\n}\n\nvoid setup() {\n  // other setup ...\n  app.get(\"/cats\", \u0026queryParams);\n}\n```\n\n### Route paramaters\n```cpp\n// HTTP GET /cats/lolcat\nvoid routeParams(Request \u0026req, Response \u0026res) {\n  char catId[64];\n  req.route(\"catId\", catId, 64);\n\n  res.print(catId);\n}\n\nvoid setup() {\n  // other setup\n  app.get(\"/cats/:catId\", \u0026routeParams);\n}\n```\n\n### Post parameters\n```cpp\nvoid postParams(Request \u0026req, Response \u0026res) {\n  char name[10];\n  char value[64];\n\n  while (req.left()) {\n    req.form(name, 10, value, 64);\n    res.print(name);\n    res.print(\": \");\n    res.println(value);\n  }\n}\n\nvoid setup() {\n  // other setup\n\n  app.post(\"/form\", \u0026postParams);\n}\n```\n\n### Reading and writing headers\n```cpp\nchar userAgentBuffer[200];\n\n// HTTP GET /headers\nvoid headers(Request \u0026req, Response \u0026res) {\n  char * userAgent = req.get(\"User-Agent\"); // \"Mozilla/5.0 (Macintosh; Inte ....\"\n\n  res.set(\"Cookie\", \"lolcat\"); // will set Cookie header value to \"lolcat\"\n  res.print(userAgent);\n}\n\nvoid setup() {\n  // other setup\n\n  // header names are handled case insensitive\n  app.header(\"User-Agent\", userAgentBuffer, 200); \n  app.get(\"/useragent\", \u0026headers);\n}\n```\n\n### Routers\n```cpp\nApplication app;\nRouter cats;\n\nvoid looooong(Request \u0026req, Response \u0026res) {\n  res.print(\"looooong cat is long!\");\n}\n\nvoid ceiling(Request \u0026req, Response \u0026res) {\n  res.print(\"ceiling cat is watching you debug!\");\n}\n\nvoid nyannyan(Request \u0026req, Response \u0026res) {\n  for (int i = 0; i \u003c 100; i++) {\n      res.print(\"nyan \");\n  }\n}\n\nvoid setup() {\n  // other setup\n\n  cats.get(\"/long\", \u0026looooong);\n  cats.get(\"/ceiling\", \u0026ceiling);\n  cats.get(\"/nyan\", \u0026nyannyan);\n\n  app.use(\"/cats\", \u0026cats);\n}\n```\n\n### Reducing memory usage\nIf you need to reduce the memory consumption add `#define LOW_MEMORY_MCU` before you import the library. This will reduce the size of a few internal buffers. Normally this is only used for the smallest AVR boards but it can be enabled for others if needed.\n\nAlso use the `P` macro to place any strings in to the program memory instead of wasting the precious RAM.\n\n```\nP(longString) = \"Lots of text here...\";\nres.printP(longString);\n```\n\n## Acknowledgements\nBased on Webduino, Copyright 2009-2014 Ben Combee, Ran Talbott, Christopher Lee, Martin Lormes, Francisco M Cuenca-Acuna\n\n## Licence\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasselukkari%2FaWOT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasselukkari%2FaWOT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasselukkari%2FaWOT/lists"}