   digitalWrite(led, 0);
 }
 
+static void handleNetworks() {
+  digitalWrite(led, 1);
+
+  int8_t netCount = WiFi.scanNetworks();
+
+  String json = "{\"response\": \"ok\"";
+  json += ", \"count\": \"" + String(netCount) + "\"";
+  
+  json += ", names:[";
+  for (uint8_t i=0; i<netCount; i++) {
+    if (i > 0) json += ',';
+    json += "\"" + String(WiFi.SSID(i)) + "\"";
+  }
+  json += "]}";
+
+  server.send(200, F("application/json"), json);
+
+  digitalWrite(led, 0);
+}
+
 static void handleNotFound()
 {
   digitalWrite(led, 1);

  server.on("/", handleRoot);
  server.on("/batch", handleBatch);
  server.on("/style.css", handleStyle);
  server.onNotFound(handleNotFound);
  
  server.begin();

#include "WebPages.h"

/* Settings you may want to configure for your LogoBot */
#define LOGOBOT_SSID "LogobotPG"
#define LOGOBOT_PWD "logobot1"
#define LOGOBOT_URL "logo.bot"
static const IPAddress apIP(192, 168, 4, 1);
