micropython web_自翻自用系列-MicroPython的MicroWebSrv

本文介绍了MicroPython平台上的轻量级HTTP服务器MicroWebSrv,支持WebSocket、HTML/Python和路由功能。文章提供了如何启动、停止服务器,设置404页面,以及使用路由和WebSockets的基本示例。同时强调了阅读英文原版文档的重要性。
摘要由CSDN通过智能技术生成

之前我们介绍过在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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值