| 16 | const uint8_t inputs[] = {5, 2}; |
| 17 | |
| 18 | void onIndex(HttpRequest& request, HttpResponse& response) |
| 19 | { |
| 20 | TemplateFileStream* tmpl = new TemplateFileStream("index.html"); |
| 21 | auto& vars = tmpl->variables(); |
| 22 | String gpioList; |
| 23 | for(unsigned i = 0; i < ARRAY_SIZE(inputs); ++i) { |
| 24 | String s = F("<span id=\"gpio{id}\" class=\"label label-default\">GPIO{gpio}</span> "); |
| 25 | s.replace("{id}", String(i)); |
| 26 | s.replace("{gpio}", String(inputs[i])); |
| 27 | gpioList += s; |
| 28 | } |
| 29 | vars["gpio_list"] = gpioList; |
| 30 | response.sendNamedStream(tmpl); // this template object will be deleted automatically |
| 31 | } |
| 32 | |
| 33 | void onFile(HttpRequest& request, HttpResponse& response) |
| 34 | { |
nothing calls this directly
no test coverage detected