Express在windowsIIS上部署詳解
Express在windowsIIS上部署詳解
閱讀次數:128 次 來源:admin 發布時間:最近公司在用Express+angularjs+wcf開發系統,部署讓我在windows上部署系統,詳解遇到不少問題,部署不過最后還是詳解解決了,在IIS上部署系統,部署
首先windows需安裝以下軟件:
1.nodejs;
2.iisnode;
3.rewrite;
安裝這三個軟件后,詳解之后部署和部署asp.net程序一樣,部署這里就不多說了;
不過要在根目錄下要價格配置文件:web.config
<configuration> <system.webServer> <!-- indicates that the hello.js file is 詳解a node.js application to be handled by the iisnode module --> <handlers> <add name="iisnode" path="index.js" verb="*" modules="iisnode"/> </handlers> <!-- use URL rewriting to redirect the entire branch of the URL namespace to hello.js node.js application; for example, the following URLs will all be handled by hello.js: http://localhost/node/express/myapp/foo http://localhost/node/express/myapp/bar --> <rewrite> <rules> <rule name="***"> <match url="/*"/> <action type="Rewrite" url="index.js"/> </rule> </rules> </rewrite> <iisnode loggingEnabled="false" logDirectory="iisnode" devErrorsEnabled="false" nodeProcessCommandLine=""%programfiles%\nodejs\node.exe"" interceptor=""%programfiles%\iisnode\interceptor.js""/> </system.webServer> <system.web> <compilation debug="true"/> </system.web></configuration>
里面的url可以為你的啟動文件app.js,這里index我們直接用的部署www文件改為了index.js,丟到了根目錄下。詳解
軟件iisnode的部署版本:iisnode-full-v0.2.11-x86.msi。
詳解未經允許不得轉載:>貴州網站建設公司 » Express在windowsIIS上部署詳解