部署Meteorjs当路径在web.config中使用 [英] Path to use in web.config when deploying Meteorjs

查看:152
本文介绍了部署Meteorjs当路径在web.config中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图部署meteorjs应用Azure中,一切看起来正确配置,但我不知道该怎么指向:

Trying to deploy a meteorjs app to Azure, everything looks configured correctly except I'm not sure what to point to:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation batch="false" />
  </system.web>
  <system.webServer>
    <handlers>
      <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
    </handlers>
    <rewrite>
      <rules>
        <rule name="myapp">
              <match url="/*" />
          <action type="Rewrite" url="server.js" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

我没有一个 server.js 。我从nitrous.io,其中应用程序按预期工作部署此。我是否需要添加一个server.js文件,如果有的话,应该是什么内容?否则,哪些文件是合适的指向?

I do not have a server.js. I am deploying this from nitrous.io, where the app works as expected. Do I need to add a server.js file, and if so, what should be the content? Otherwise, what file is appropriate to point to?

推荐答案

建造流星应用上产量 main.js 在应用程序的根文件夹,您应该指向您的Web服务器到这个文件。

Builded Meteor Application on output has main.js in root folder of your application, you should point your web server onto this file.

在重写规则使用常规的前pression:

In rewrite rule use regular expression:

<match url="^(.*)$" ignoreCase="false" />

所以你的配置文件将是:

So your config file will be:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation batch="false" />
  </system.web>
  <system.webServer>
    <handlers>
      <add name="iisnode" path="main.js" verb="*" modules="iisnode" />
    </handlers>
    <rewrite>
      <rules>
        <rule name="myapp">
          <match url="^(.*)$" ignoreCase="false" />
          <action type="Rewrite" url="main.js" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

另外,不要忘记设置ENV变量建造流星: MONGO_URL ROOT_URL (含协议域,像: http://my.site ), MAIL_URL 等。

Also do not forget to set ENV variables for builded Meteor: MONGO_URL, ROOT_URL (domain with protocol, like: http://my.site), MAIL_URL, etc.

这篇关于部署Meteorjs当路径在web.config中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆