devwiki:litestar

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
devwiki:litestar [2023/08/24 08:07] – created yingdevwiki:litestar [2023/08/29 07:13] – [Concepts] ying
Line 8: Line 8:
       * uvicorn       * uvicorn
       * jsbeautifier       * jsbeautifier
 +
 +====== Concepts ======
 +
 +  * it provides a active server, allow other pc or program to communicate with it
 +  * it use url to point to each function of the app.py <code python>
 +# (python decorator: a function repackage method, put below function as a component of decorator function)
 +# so, the decoration function is like a white-label procedure function, need input function as lego part to output different behaved white-label funciton. 
 +@get("/")
 +async def func_a() -> str:
 +
 +# same as below, get("/") return a the get white-label function, and take func_a as component to output a different behaved white-label function, and use the same function variable func_a, (like a repackage of func_a in white-label box)
 +func_a = get("/")(func_a)
 +</code>
 +
 +  * ASGI: Asynchronous Server Gateway Interface
 +    * newer for python, non block commu
 +  * WSGI: Web Server Gateway Interface
 +
 +  * litestar use Uvicorn ASGI server, which support http, websockets and other realtime protocol
 +    * https://www.uvicorn.org/
 +
 +  * litestar auto create the scheme and scheme tryout page
 +    * http://127.0.0.1:8000/schema/
 +    * http://127.0.0.1:8000/schema/swagger
  • devwiki/litestar.txt
  • Last modified: 2023/08/29 09:31
  • by ying