之前我们介绍过在python中写socket,当然那样还是太麻烦,有没有像pc端apache一样的支持n多功能,牛逼的现成服务器软件呢 MicroWebSrv闪亮登场!!!下面文章出处,MicroPython github官网:https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/microWebSrv
microwebsrv作者github:
https://github.com/jczic/MicroWebSrv
MicroWebSrv 是一个在MicroPython平台上支持websocket,html/python,路由功能的微型http服务器
配件的配置如下:run microWebServer in thread 在线程里运行microWebServer
do NOT run MicroWebSocket in thread 不在线程里运行MicroWebServer
想要使用它需要只需要拷贝三个文件,这是非常轻量级和一体化的
"microWebSrv.py" - The Web server
"microWebSocket.py" - The optional support of WebSockets
"microWebTemplate.py" - The optional templating language for .pyhtmlrendered pages
简单但高效:Use it to embed a cool Web site in yours modules
Handle GET, POST, ... requests to interract with user and configure options
Exchange in JSON format on HTTP methods to make an embedded fullREST API
Serve files on the fly to export any data to the user
Use routes and variable route handlers
Play with AjAX to interact speedly with a Web application
Make it a captive portal simpl