Home

Awesome

<h3> <p align="center"> Also check out the new ESP32 MPY-Jama free IDE below: </p> </h3> <p align="center"> <a href="https://github.com/jczic/ESP32-MPY-Jama"><img src="https://github.com/jczic/ESP32-MPY-Jama/raw/master/img/ESP32%20MPY-Jama%20NEW.png" alt="New microWebSrv2" width="350" valign="middle"></a> </p>

Release Size MicroPython Python License

<br />

MicroWebSrv2 is the new powerful embedded Web Server for MicroPython and CPython that supports route handlers, modules like WebSockets or PyhtmlTemplate and a lot of simultaneous requests (in thousands!).

Fully asynchronous, its connections and memory management are very optimized and truly fast.

Mostly used on Pycom WiPy, ESP32, STM32 on Pyboard, ... Robust and efficient! (see Features)

:small_orange_diamond: Download the latest version (Zip)

<br />
                _               __    __     _     __            ____  
      _ __ ___ (_) ___ _ __ ___/ / /\ \ \___| |__ / _\_ ____   _|___ \ 
     | '_ ` _ \| |/ __| '__/ _ \ \/  \/ / _ | '_ \\ \| '__\ \ / / __) |
     | | | | | | | (__| | | (_) \  /\  |  __| |_) _\ | |   \ V / / __/ 
     |_| |_| |_|_|\___|_|  \___/ \/  \/ \___|_.__/\__|_|    \_/ |_____|  JC`zic & HC²



<br />

:bookmark_tabs:  Table of contents


<a name="about"></a>

:anger:  About

This project follows the embedded MicroWebSrv, which is mainly used on microcontrollers such as Pycom, ESP32 and STM32 on Pyboards.

In a need for scalability and to meet the IoT universe, microWebSrv2 was developed as a new project and has been completely redesigned to be much more robust and efficient that its predecessor.

Internal mechanisms works directly at I/O level, are fully asynchronous from end to end, and manages the memory in a highly optimized way.
Also, architecture makes its integration very easy and the source code, MIT licensed, remains really small.


<a name="features"></a>

:rocket:  Features


<a name="install"></a>

:electric_plug:  Install

    pip3 install --user git+https://github.com/jczic/MicroWebSrv2.git#egg=MicroWebSrv2
    git clone https://github.com/jczic/MicroWebSrv2.git
    and run:
    cd MicroWebSrv2 && pip install --user .

<a name="demo"></a>

:vertical_traffic_light:  Demo

  1. Start the example:

    > python3 main.py
    
  2. Open your web browser at:

WebSockets Chat


<a name="usage"></a>

:gear:  Usage

from MicroWebSrv2 import *
from time         import sleep

mws2 = MicroWebSrv2()
mws2.StartManaged()

# Main program loop until keyboard interrupt,
try :
    while True :
        sleep(1)
except KeyboardInterrupt :
    mws2.Stop()

<a name="documentation"></a>

:books:  Documentation

<a name="mws2-package"></a>

<a name="working-with-mws2"></a>

<a name="xasyncsockets"></a>

<a name="mws2-class"></a>

<a name="web-routes"></a>

<a name="request-class"></a>

<a name="response-class"></a>

<a name="modules"></a>


<a name="author"></a>

:wink:  Author

Jean-Christophe Bos (:fr:)


<a name="license"></a>

:eight_pointed_black_star:  License


<br />