zoukankan      html  css  js  c++  java
  • 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%
    odejs
    ode.exe"" interceptor=""%programfiles%iisnodeinterceptor.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。

  • 相关阅读:
    关于ListView的注意点
    推荐一波 瀑布流的RecylceView
    RecycleView的简单应用
    Java Junit单元测试
    Java 2 个 List 集合数据求并、补集操作
    Java @Validated 遇到的大坑
    Java中的Validated验证
    使用一条sql语句查询多表的总数
    Java thymeleaf模板获取资源文件的内容
    Java热启动
  • 原文地址:https://www.cnblogs.com/bobo-show/p/5002790.html
Copyright © 2011-2022 走看看