gpt4 book ai didi

azure - 如何将 MeteorJS 应用程序部署到 Windows Azure?

转载 作者:行者123 更新时间:2023-12-04 11:09:36 25 4
gpt4 key购买 nike

如何将生产 MeteorJS 应用程序部署到 Windows Azure?

最佳答案

是的。请参阅http://www.meteorpedia.com/read/Deploying_to_a_PaaS

In most cases this is as simple as using "meteor bundle", demeteorizer, and then uploading the resulting files with your PaaS provider's CLI deploy tool.

Demeteorizer wraps and extends Meteor’s bundle command by creating something that more closely resembles a standard looking Node.js application, complete with a package.json file for dependency management.

$ cd /my/meteor/app
$ demeteorizer -o /my/node/app
$ cd /my/node/app
$ npm install
$ export MONGO_URL='mongodb://user:password@host:port/databasename?autoReconnect=true&connectTimeout=60000'
$ export PORT=8080
$ forever start main.js

Forever让您的应用程序在断开连接或崩溃后继续运行,but not a reboot unless you manually add a boot entry .

整个部署是much easier使用Meteor Up反而。或者也许mups ,尽管它甚至没有更新的文档。

要在 Azure Web 应用中运行 Meteor 应用:

Azure Web App 
Python 2.7
Websockets ON (optional)
WEBSITE_NODE_DEFAULT_VERSION 0.10.32 (default)
ROOT_URL http://webapp.azurewebsites.net
MONGO_URL mongodb://username:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e494859797938b9680a48d8a9790858a8781ca898b8a838b888586ca878b89" rel="noreferrer noopener nofollow">[email protected]</a>:36648/dbname (For advanced apps. Request log should say if you need it.)

Dev Machine
Install Visual Studio Community 2015
Install Node 0.12.6
Install Meteor MSI

app> demeteorizer -o ..\app-dem
app-dem\programs\server\packages\webapp.js change .PORT line to "var localPort = process.env.PORT"
app-dem\package.json change "node": "0.10.36" to "node": "0.12.6"
app-dem> npm install
app-dem> git init
app-dem> git add -A .
app-dem> git commit -m "version 1.0 demeteorized Meteor + tweaks"
app-dem> git remote add azure https://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="70050315021e111d15300715121100005d031c1f045e03131d5e110a05021507151203190415035e1e1504" rel="noreferrer noopener nofollow">[email protected]</a>:443/webapp.git
app-dem> git config http.postBuffer 52428800
app-dem> git push azure master

也许您可以使用 meteor build 并在输出根目录中创建 package.json,而不是 demeteorizer -o:

{
"name": "App name",
"version": "0.0.1",
"main": "main.js",
"scripts": {
"start": "node main.js"
},
"engines": {
"node": "0.12.6"
}
}

如果 bcrypt 无法编译,请确保使用更新的版本:

    "dependencies": {
"bcrypt": "https://registry.npmjs.org/bcrypt/-/bcrypt-0.8.4.tgz"
}

关于azure - 如何将 MeteorJS 应用程序部署到 Windows Azure?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14266386/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com