首页 > Windows开发 > 详细

Express在windows IIS上部署详解

时间:2015-11-28 16:34:15      阅读:400      评论:0      收藏:0      [点我收藏+]

最近公司在用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在windows IIS上部署详解

原文:http://www.cnblogs.com/bobo-show/p/5002790.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!