摘要:地址簡介用極少的代碼實(shí)現(xiàn)一款框架,目標(biāo)是用低于行的代碼實(shí)現(xiàn)的核心功能,框架基于以上開發(fā)特點(diǎn)安裝路由請求相應(yīng)中間件歡迎或者地址
簡介github地址: https://github.com/gaojiuli/xweb
用極少的代碼實(shí)現(xiàn)一款web框架,目標(biāo)是用低于1000行的代碼實(shí)現(xiàn)flask的核心功能,xweb框架基于python3.5以上開發(fā)
特點(diǎn)few code
do more
no dependencies
安裝pip install xweb
hello worldfrom xweb.application import XWeb app = XWeb() @app.route("/") def hello(): return "hello world!" app.listen(3000)路由
from xweb.application import XWeb app = XWeb() @app.route("/:name/") def call_my_name(name): return "hi {}!".format(name) app.listen(3000)請求
from xweb.globals import request request.path request.query_string request.query request.files request.forms request.json request.ip request.hostname request.headers相應(yīng)
from xweb.globals import response response.headers response.status response.body中間件
from xweb.application import XWeb app = XWeb() @app.middleware("request") def print_on_request1(): print("I print when a request is received by the server1") @app.middleware("request") def print_on_request2(): print("I print when a request is received by the server2") @app.middleware("response") def print_on_response1(): print("I print when a response is returned by the server1") @app.middleware("response") def print_on_response2(): print("I print when a response is returned by the server2") @app.route("/:name/") def call_my_name(name): return "hi {}!".format(name) app.listen(3000)TODO
more http status code
some necessary middleware
enough test code
support blueprint
a cool logo
歡迎star或者fork
github地址: xweb
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/38484.html
摘要:地址簡介用極少的代碼實(shí)現(xiàn)一款框架,目標(biāo)是用低于行的代碼實(shí)現(xiàn)的核心功能,框架基于以上開發(fā)特點(diǎn)安裝路由請求相應(yīng)中間件歡迎或者地址 github地址: https://github.com/gaojiuli/xweb 簡介 用極少的代碼實(shí)現(xiàn)一款web框架,目標(biāo)是用低于1000行的代碼實(shí)現(xiàn)flask的核心功能,xweb框架基于python3.5以上開發(fā) 特點(diǎn) few code do more...
摘要:簡介項(xiàng)目地址眾所周知如今的后端開發(fā)主要是負(fù)責(zé)接口的開發(fā)而前后端分離又是當(dāng)下最流行的如果使用技術(shù)棧通常情況下我們會選擇全套或者他們的模板引擎功能在當(dāng)下的后端開發(fā)中是基本不用的同時(shí)由于它們開始的時(shí)候是基于寫的造成了現(xiàn)在代碼中充斥著大量丑陋的兼容 簡介 showImg(https://segmentfault.com/img/remote/1460000008633918?w=280&h=1...
摘要:為什么我會說它們是一樣的簡單思考一下我的后端書架后端掘金我的后端書架月前本書架主要針對后端開發(fā)與架構(gòu)。一方案調(diào)研版本選擇當(dāng)前主流版本是和應(yīng)用的后臺運(yùn)行配置后端掘金醬油一篇,整理一下關(guān)于后臺運(yùn)行的一些配置方式。 分享 50 個(gè)完整的 React Native 項(xiàng)目 - 掘金本文為 Marno 原創(chuàng),轉(zhuǎn)載必須保留出處! 公眾號 aMarno,關(guān)注后回復(fù) RN 加入交流群 簡書專題《 Rea...
摘要:發(fā)布于之后,采用了完全不同的方式,使用函數(shù)定義任務(wù)。它允許開發(fā)者使用它們的補(bǔ)丁和更新來修復(fù)這些安全漏洞。提供了工具用于掃描依賴來監(jiān)測漏洞。是一個(gè)開源診斷工具,用于和應(yīng)用。是和開發(fā)的一款新的包管理工具。與相比,它解決了安全性能以及一致性問題。 譯者按: 最全的JavaScript開發(fā)工具列表,總有一款適合你! 原文: THE ULTIMATE LIST OF JAVASCRIPT TOO...
閱讀 2492·2021-09-22 16:05
閱讀 2980·2021-09-10 11:24
閱讀 3655·2019-08-30 12:47
閱讀 2956·2019-08-29 15:42
閱讀 3398·2019-08-29 15:32
閱讀 1983·2019-08-26 11:48
閱讀 1098·2019-08-23 14:40
閱讀 911·2019-08-23 14:33