Express在windows IIS上部署详解

最近公司在用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。

转载于:https://www.cnblogs.com/bobo-show/p/5002790.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值