Code: Select all
import ure as re
import picoweb
ROUTES = [
("/", lambda req, resp: (yield from app.sendfile(resp, "/wwwroot/index.html"))),
(re.compile("^/(.+)"), lambda req, resp: (yield from app.sendfile(resp, "/wwwroot/" + req.url_match.group(1)))),
]
import logging
logging.basicConfig(level=logging.INFO)
app = picoweb.WebApp(None, ROUTES)
app.run(debug=True,host="0.0.0.0")
Anyway, it is quite exciting that we have tools like this to work with!