您可以在没有meteor 的计算机上运行meteor 包example.tar.z 吗? [英] Can you run a meteor bundle, example.tar.z , on a computer that doesn't have meteor?

查看:33
本文介绍了您可以在没有meteor 的计算机上运行meteor 包example.tar.z 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用

meteor bundle iron.tar.gz

我可以在没有安装meteor 的另一台计算机上本地运行应用程序(localhost:3000).如果是这样,我将如何去做?感谢您的帮助!

can I run the app locally, (localhost:3000), on a different computer that does not have meteor installed. If so, how would I go about doing it? Thanks for the help!

推荐答案

Meteor 片段将捆绑在您的meteor 包中,但您需要在另一个盒子上安装 Node.js 和 NPM.我使用 Forever 以便它保持正常运行并有两个脚本.这个将包名称作为参数,并根据 Meteor 的 指令 将包安装到一个永远可以使用的目录中:

Meteor pieces will be bundled in your meteor bundle, but you're going to need to have Node.js and NPM installed on that other box. I use Forever so that it stays up and running and have two scripts. This one takes the bundle name as an argument and installs the bundle per Meteor's instructions into a directory forever can use:

#!/bin/sh

if [ -d "$1" ]
then
   rm -rf $1
fi

mkdir $1
cp ~/$1.tgz ./$1
cd ./$1

tar xvfz $1.tgz

rm -rf bundle/programs/server/node_modules/fibers/
npm install fibers@1.0.1

然后我可以运行下一个脚本,该脚本将项目名称作为输入并永远针对 MongoDB 副本集启动它:

And then I can run the next script that will take the project name as an input and start it in forever against a MongoDB replica set:

#!/bin/sh

export PORT=3000
export MONGO_URL=mongodb://id:pwd@replica1.yourcompany.com:27017,replica2.yourcompany.com:27017,replica3.yourcompany.com:27017/meteor
forever start $1/bundle/main.js

运行该脚本后,您可以从本地主机启动它或将 nginx 设置为 HTTP 服务器,它们可以代理它并通过端口 80/443 在您的主机上运行.

After you run that script you can launch it off localhost or setup nginx as an HTTP server that can they proxy it and run on your host over port 80/443.

这篇关于您可以在没有meteor 的计算机上运行meteor 包example.tar.z 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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