Serving HTML pages.
Posted: Thu May 14, 2015 6:04 pm
I've seen the example webserver, but all the returned html/text has been hardcoded. Is there any way to serve separate webpages?
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
srv=net.createServer(net.TCP)
srv:listen(8266,function(conn)
conn:on("receive", function(client,request)
.
.
.
file.open("mypage.htm","r")
while true do
str = file.readline()
if str == nil then break end
client:send(buf);
end
file.close()
end)
end)