<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                中間件:就是`匹配路由之前或者匹配路由完成后`做得一系列操作,我們就可以把它叫中間件。 在`express中間件(Middleware)`是一個函數。它可以訪問請求對象`(request object(req))`,響應對象`(response object(res)),`和web應用中處理請求——響應循環流程中的中間件,一般被命名為next的變量。在koa中中間件和express優點類似。 #### 中間件的功能包括: - 執行任何代碼 - 修改請求和響應對象 - 終結請求-響應循環 - 調用堆棧中的下一個中間件 如果我們的get,post回調函數中,沒有next參數,那么就匹配上第一個路由,就不會往下匹配了。如果想往下匹配的話,那么需要些next(); ## 一、koa應用可使用以下中間件 - 應用級中間件 - 路由級中間件 - 錯誤處理中間件 - 第三方中間件 ### 1.應用中間間 ~~~ //app.use(middleware)匹配所有路由 app.use(async (ctx,next)=>{ console.log(new Date()); await next() console.log("路由完成后") }) ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看