MCPcopy Create free account
hub / github.com/SmingHub/Sming / startWebServer

Function startWebServer

samples/MeteoControl/app/webserver.cpp:132–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void startWebServer()
133{
134 if(serverStarted) {
135 return;
136 }
137
138 server.listen(80);
139 server.paths.set("/", onIndex);
140 server.paths.set("/api", onApiDoc);
141 server.paths.set("/api/sensors", onApiSensors);
142 server.paths.set("/api/output", onApiOutput);
143 server.paths.set("/config", onConfiguration);
144 server.paths.setDefault(onFile);
145 serverStarted = true;
146
147 if(WifiStation.isEnabled())
148 debugf("STA: %s", WifiStation.getIP().toString().c_str());
149 if(WifiAccessPoint.isEnabled())
150 debugf("AP: %s", WifiAccessPoint.getIP().toString().c_str());
151}

Callers 3

downloadContentFilesFunction · 0.70
gotIPFunction · 0.70
connectFailFunction · 0.70

Calls 7

setDefaultMethod · 0.80
listenMethod · 0.45
setMethod · 0.45
isEnabledMethod · 0.45
c_strMethod · 0.45
toStringMethod · 0.45
getIPMethod · 0.45

Tested by

no test coverage detected