(window.webpackJsonp=window.webpackJsonp||[]).push([[144],{601:function(t,e,r){"use strict";r.r(e);var a=r(21),s=Object(a.a)({},(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"nonebot-drivers-fastapi-模块"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nonebot-drivers-fastapi-模块"}},[t._v("#")]),t._v(" NoneBot.drivers.fastapi 模块")]),t._v(" "),r("h2",{attrs:{id:"fastapi-驱动适配"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#fastapi-驱动适配"}},[t._v("#")]),t._v(" FastAPI 驱动适配")]),t._v(" "),r("p",[t._v("后端使用方法请参考: "),r("a",{attrs:{href:"https://fastapi.tiangolo.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("FastAPI 文档"),r("OutboundLink")],1)]),t._v(" "),r("h2",{attrs:{id:"class-driver"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#class-driver"}},[t._v("#")]),t._v(" "),r("em",[t._v("class")]),t._v(" "),r("code",[t._v("Driver")])]),t._v(" "),r("p",[t._v("基类："),r("router-link",{attrs:{to:"./#nonebot.drivers.Driver"}},[r("code",[t._v("nonebot.drivers.Driver")])])],1),t._v(" "),r("p",[t._v("FastAPI 驱动框架")]),t._v(" "),r("ul",[r("li",[r("p",[r("strong",[t._v("上报地址")])]),t._v(" "),r("ul",[r("li",[r("p",[r("code",[t._v("/{adapter name}/")]),t._v(": HTTP POST 上报")])]),t._v(" "),r("li",[r("p",[r("code",[t._v("/{adapter name}/http/")]),t._v(": HTTP POST 上报")])]),t._v(" "),r("li",[r("p",[r("code",[t._v("/{adapter name}/ws")]),t._v(": WebSocket 上报")])]),t._v(" "),r("li",[r("p",[r("code",[t._v("/{adapter name}/ws/")]),t._v(": WebSocket 上报")])])])])]),t._v(" "),r("h3",{attrs:{id:"property-type"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#property-type"}},[t._v("#")]),t._v(" "),r("em",[t._v("property")]),t._v(" "),r("code",[t._v("type")])]),t._v(" "),r("p",[t._v("驱动名称: "),r("code",[t._v("fastapi")])]),t._v(" "),r("h3",{attrs:{id:"property-server-app"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#property-server-app"}},[t._v("#")]),t._v(" "),r("em",[t._v("property")]),t._v(" "),r("code",[t._v("server_app")])]),t._v(" "),r("p",[r("code",[t._v("FastAPI APP")]),t._v(" 对象")]),t._v(" "),r("h3",{attrs:{id:"property-asgi"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#property-asgi"}},[t._v("#")]),t._v(" "),r("em",[t._v("property")]),t._v(" "),r("code",[t._v("asgi")])]),t._v(" "),r("p",[r("code",[t._v("FastAPI APP")]),t._v(" 对象")]),t._v(" "),r("h3",{attrs:{id:"property-logger"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#property-logger"}},[t._v("#")]),t._v(" "),r("em",[t._v("property")]),t._v(" "),r("code",[t._v("logger")])]),t._v(" "),r("p",[t._v("fastapi 使用的 logger")]),t._v(" "),r("h3",{attrs:{id:"on-startup-func"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#on-startup-func"}},[t._v("#")]),t._v(" "),r("code",[t._v("on_startup(func)")])]),t._v(" "),r("p",[t._v("参考文档: "),r("a",{attrs:{href:"https://fastapi.tiangolo.com/advanced/events/#startup-event",target:"_blank",rel:"noopener noreferrer"}},[t._v("Events"),r("OutboundLink")],1)]),t._v(" "),r("h3",{attrs:{id:"on-shutdown-func"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#on-shutdown-func"}},[t._v("#")]),t._v(" "),r("code",[t._v("on_shutdown(func)")])]),t._v(" "),r("p",[t._v("参考文档: "),r("a",{attrs:{href:"https://fastapi.tiangolo.com/advanced/events/#startup-event",target:"_blank",rel:"noopener noreferrer"}},[t._v("Events"),r("OutboundLink")],1)]),t._v(" "),r("h3",{attrs:{id:"run-host-none-port-none-app-none-kwargs"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#run-host-none-port-none-app-none-kwargs"}},[t._v("#")]),t._v(" "),r("code",[t._v("run(host=None, port=None, *, app=None, **kwargs)")])]),t._v(" "),r("p",[t._v("使用 "),r("code",[t._v("uvicorn")]),t._v(" 启动 FastAPI")])])}),[],!1,null,null,null);e.default=s.exports}}]);