<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 功能強大 支持多語言、二開方便! 廣告
                ## 一、概述 Node.js是一個事件驅動I/O服務端JavaScript環境,基于Google的V8引擎,V8引擎執行Javascript的速度非常快,性能非常好。 Node.js 是一個讓 JavaScript 運行在服務端的開發平臺,它讓 JavaScript 成為與PHP、Python、Perl、Ruby?等服務端語言平起平坐的腳本語言。 參考:[http://nodejs.cn/api/](http://nodejs.cn/api/) ## 二、簡單網站應用 node.js可以替代nginx、apache等web服務器,只需要用npm安裝一些組件即可; 1、創建一個目錄,作為獨立運行的server,執行npm init; ``` npm init ``` ![](https://img.kancloud.cn/6c/d4/6cd4bb4bb8b040daca6be8edf63a577b_661x716.png) 2、當前目錄安裝express包; ``` npm install express -save ``` ![](https://img.kancloud.cn/0a/45/0a451e379fe5e85616295de2b876e3a7_677x475.png) 3、全局安裝forever包,可以讓服務器服務一直跑起來; ``` npm install forever -g ``` ![](https://img.kancloud.cn/f5/6c/f56c986701e2d7bb540ec6d0f2d59590_677x475.png) 4、新建一個服務js文件; index.js文件; ``` let express = require("express"); let app = express(); app.use(express.static("pages"));// app.listen(8080, ()=>{console.log("服務啟動成功。");}) ``` 5、運行服務命令,服務啟動成功; ``` forever start index.js ``` ![](https://img.kancloud.cn/34/72/34723628795b57ea0104a8f92513fd3d_677x475.png) 關閉 ``` forever stop index.js ``` ![](https://img.kancloud.cn/1c/bb/1cbbb4706c3f36ecd9c80e8f8e4cece6_677x475.png) 6、訪問 pages就作為靜態網頁的根目錄可以訪問了 ![](https://img.kancloud.cn/ae/c8/aec842885da0c2f374e79f7d685e558c_888x209.png) http://localhost:8080/a.html ![](https://img.kancloud.cn/72/18/7218051c4b6a12978a2ac8802c123e41_1366x736.png)
                  <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>

                              哎呀哎呀视频在线观看