<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                最重要的功能是路由功能,根據不同的方法和不同的路徑返回不同的內容 路由,誰先定義誰先匹配,匹配完成時一般就結束響應了。 ``` app.get(path,fn) app.post(path,fn) app.all() //all代表匹配所有方法 ``` ``` app.all('\*',fn) //代表匹配所有方法所有路徑,一般用在都不匹配時進行兼容處理 ``` ## 中間件 ``` app.use(path,function(req,res,next){ //多了一個next參數 res.end('over'); //中間間也可以結束響應 next(); //繼續從上往下匹配 }) ``` ### next ### next傳參 調用next的時候如果傳一個任意參數就表示此函數發生了錯誤,然后express就會跳過后面所有的中間件并交給錯誤中間件來處理。 錯誤中間件和其它中間件的區別在于它有四個參數,多了一個err app.use(function(err,req,res,next){ res.end('錯誤處理中間件'+err) }) ## params ``` /user?name=zfpx&age=8 //內部靠的是一個內置中間件 app.get('/usr',function(req,res){ console.log(req.query); // {name:zfpx,age:8} console.log(req.path); // /user console.log(req.hostname); // res.end('ok'); }); // 原生http中我們需要對headers['url']進行解析 ```
                  <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>

                              哎呀哎呀视频在线观看