安裝nodeJs靜態伺服器(NodeJs Express MVC 架構)

來源:互聯網
上載者:User

標籤:靜態伺服器   blog   image   安裝   目錄   localhost   logs   amp   images   

安裝 NodeJs Express MVC 架構 建立專案檔夾 開啟cmd 執行以下操作: 一、使用Express架構1)安裝express3 $: npm install -g [email protected]2)目錄下建立工程 $: express -e staticServer3)安裝所需模組 $: cd staticServer && npm install這部執行完畢即可啟動伺服器 $: node appexpress預設public目錄為靜態資源目錄,可在瀏覽器中訪問http://localhost:3000/images/******對應資源 建立完成後:1、建立wwwroot檔案夾2、修改根目錄下app.js配置  完成以上操作  在 cmd 執行 node app/node app.js   預設連接埠號碼為:3000  nodeJs  靜態伺服器 完成!

安裝nodeJs靜態伺服器(NodeJs Express MVC 架構)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.