EzDevInfo.com

demeteorizer

Converts a Meteor app into a "standard" Node.js application. demeteorizer converts a meteor app into a "standard" node.js application.

Deploy Meteor.js app by running `mrt` or `meteor`

Why are Meteor.js apps not deployed by uploading to a server by doing the following:

  1. Install npm
  2. Install meteor $ curl https://install.meteor.com | /bin/sh
  3. meteor create myApp
  4. Upload Meteor code files from development system
  5. Deploy using meteor

And instead deployment guides are instructing us to convert Meteor apps into node.js modules using demeteorizer and manually installing Mongo etc which are much more tedious.


Source: (StackOverflow)

modulus.io #meteor 1.0.0 failed deploy '/mnt/data/2/programs/server/app/node_modules/underscore/underscore-min.js'

When attempting to deploy a meteor 1.0.0 app on modulus I get an error message about a non-existing underscore-min.js.

Both demeteorizer and modulus toolbelt at the latest version.

Error: ENOENT, no such file or directory '/mnt/data/2/programs/server/app/node_modules/underscore/underscore-min.js'
    at Object.fs.openSync (fs.js:438:18)
    at Object.fs.readFileSync (fs.js:289:15)
    at /mnt/data/2/programs/server/boot.js:83:19
    at Array.forEach (native)
    at Function._.each._.forEach (/mnt/data/2/node_modules/underscore/underscore.js:79:11)
    at /mnt/data/2/programs/server/boot.js:82:5
[2015-01-03T18:48:01.182Z] Application CRASH detected. Exit code 8.

Source: (StackOverflow)

Advertisements

Meteor app deploying with Modulus

I'm getting this error when I try typing $modulus deploy into terminal from my app directory:

Determining Meteor version...
Meteor version: 1.1.0.2
Bundling Meteor App...
undefined
[Error] Error: Command failed: /bin/sh -c cd /Users/xx/Projects/Project1 && meteor bundle   --directory /Users/xx/Projects/Project1/.demeteorized
This command has been deprecated in favor of 'meteor build', which allows you
to build for multiple platforms and outputs a directory instead of a single
tarball. See 'meteor help build'for more information.


WARNING: The output directory is under your source tree.

Errors prevented bundling:
While building the application:
client/Project1.js:138:29: Unexpected token =

I get the same result with $demeteorizer. It worked on an old version of the app, then I added some features in new branch, merged, and now I'm getting this error.

Already tried:
sudo npm update -g modulus


Source: (StackOverflow)

Concatenate in Meteor Template Tags

I have a list of numbers in my Meteor Template which I am iterating to print the attributes of the object. I have an object named choices_object which will have number of choices depending upon the situation. objects fields will be choice_1 choice_2 choice_3 and so on. I have the same number of values in an array as object fields.

values=[1,2,3,4,5,6,7,8,9]

In my template I have to concatenate the name of objects fields with this number to complete the names of fields.

<template name="choices_template">
    {{#with choices_object}}
        {{#each values}}
            {{choice_ .}}    <!-- it should be {{choice_1}} and so on depends on the value of dot.
        {{/each}}
    {{/with}}
</template> 

Is it possible to concatenate a variable name as i am trying to do?


Source: (StackOverflow)

How to make NodeJS app on PAAS autorun?

I wrote a simple app in meteor. I used demeteorizer to remove its dependence on meteor. Now I've uploaded my demeteorized bundle to a Gandi NodeJS simple hosting instance. I can get it to run from the console, but I can't get it to automatically run when I reboot the instance.

I moved the default server.js out of the way which runs when the instance boots up. Here's what it contained:

var http = require("http");

http.createServer(function(req, res) {
    res.writeHead(200, {"Content-Type": "text/html; charset=utf-8"});
    res.end('<!DOCTYPE html><html><meta charset="utf-8"><title>It works' +
            "</title><b>It works!</b><br /><br />This is the server's " +
            "default server.js.");
}).listen(8080);
console.log("Server ready to accept requests on port 8080");

Running demeteorizer on my local machine, it created a project.json file which I uploaded with the rest of the bundle to vhosts/default dir:

hosting-user@Secret-History-Node-Test:~/web/vhosts/default$ more package.json
{
  "name": "secrethistory",
  "description": "secrethistory - automatically converted by Demeteorizer. https
://github.com/onmodulus/demeteorizer",
  "version": "0.0.1",
  "main": "main.js",
  "scripts": {
    "start": "node main.js"
  },
  "engines": {
    "node": "0.10.36"
  },
  "dependencies": {
    "websocket-driver": ">=0.4.0",
    "faye-websocket": "^0.7.3 || ^0.8.0",
    "node-uuid": "^1.4.1",
    "sockjs": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.11.tgz",
    "es5-ext": "~0.9.2",
    "event-emitter": "~0.2.2",
    "next-tick": "0.1.x",
    "memoizee": "~0.2.5",
    "cli-color": "https://registry.npmjs.org/cli-color/-/cli-color-0.2.3.tgz",
    "css-parse": "https://github.com/reworkcss/css-parse/tarball/aa7e23285375ca6

According to the demeteorizer docs, there are a few env variables I have to set before I can start node. Using the following from the command line, I can run my app successfully.

export MONGO_URL=mongodb://localhost:27017/secrethistory 
export PORT=8080 
export ROOT_URL=http://localhost:8080
node main

(Those values are a little counterintuitive and contradict what many demeteorizer tutorials state, but it comes straight from the demeteorizer docs and works.)

Given the limited access I have to the simple hosting startup scripts, I don't know how to start my app when node starts or how to set the environment variables before it runs.

Can you help me figure out how to get my app to run when the PAAS instance is booted?

More Info

Here's how node is run from the instance:

hosting-user@Secret-History-Node-Test:~/web/vhosts/default$ ps -ef | grep node
5000        73     1  0 06:06 ?        00:00:00 python /srv/admin/scripts/watchd --logfile /srv/data/var/log/www/nodejs-watchd.log --pidfile /srv/run/nodejs/nodejs-watchd.pid --app-logfile /srv/data/var/log/www/nodejs.log --app-dir /srv/data/web/vhosts/default /srv/admin/scripts/nodejs/node-bootstrap.sh

Source: (StackOverflow)

Meteor leaderboard app on node-webkit

I am trying to get the meteor leaderboard app to run on Node-Webkit. I have demeteorized it and compressed it to a .nw file but when I drop it in. I get errors:

Invalid Package There is no 'package.json' in the package, please make sure the 'package.json' is in the root of the package.

I have read on various thread but nothing clear yet. It seems like the demeteorized app needs to be restructured. Also need to figure out how to run the server [Locally/DDP].

Edited:

P.S. I am using the demeteorized files from the leaderboard meteor app to be able to run it in node-webkit.

What exactly I am trying to figure out here is :

  1. how to run/init the local node(demeteorized) server and set the port.

  2. How to set environment variables for the demeteorized app for mongodb etc.

  3. What would be used as the

"main": ?,
"node-remote": ?

for the node-webkit package.json file.

Can someone please shed some light and if possible an example will be highly appreciated.

Thanks in advanced.

Praney :)

UPDATE:

After tinkering a bit, I added the "main": "index.html" and added index.html file to the root of the demeteorized app. This file just loads the main.js file in the browser, here:

<!DOCTYPE html>
<html>
  <head>
    <title>Leaderboards</title>
  </head>
  <body>
  </body>
  <script src="main.js" type="text/javascript"></script>
</html>

Now I am getting this error:

"Uncaught ReferenceError: __dirname is not defined", source: file:///Users/Praney/projects/webkit/nw-sample-apps/leaderboards/main.js(2)

main.js

process.argv.splice(2, 0, 'program.json');
process.chdir(require('path').join(__dirname, 'programs', 'server'));
require('./programs/server/boot.js');

Source: (StackOverflow)

node-webkit with Meteor.js

After creating a simple meteor.js app and creating the demeteorized version using demeteorizer, I run nw .demeteorized but it shows me the contents of .demeteorized/main.js

enter image description here

What is the correct way of running a Meteor app on node-webkit? I was hoping that running nw .demeteorized will run the / route from iron-router.


Source: (StackOverflow)

Deploy meteor, meteor-up and/or demeteorizer?

I'm checking out my options on deploying meteor apps.

I already saw the problems of deploying meteor apps built on my mac, to remote Ubuntu server and other versioning issues, i believe more to come.

meteor-up looks like a good solution, but can it be used alongside with demeteorizer to handle dependency management?

Would that have any advantage over packaging with demeteorizing, and deploying with some othe/custom script?


Source: (StackOverflow)

Meteor as a pure Application Server

I want to use MeteorJS server as a pure Application Server, which means, I only want it to handle Publications and Server Methods. I want to have a dedicated server to serve the HTML, CSS and Javascript bundle to the client but the application would use another server to handle all the DDP connections.

Is there a non-hacky and reliable way to do this?

Would this approach help to scale an application, by removing the static content out of the way?


Source: (StackOverflow)

Demeteorizer with node-webkit

I'm trying to make a desktop application using meteor.

Can I use Demeteorizer to convert it to a standard node.js app, then use ndoe-webkit to turn it into a desktop app? My problem with this is, how would the mongodb database still work?

If this is not a valid option, is there any other way to do this?


Source: (StackOverflow)

What are the main differences of demeteorizer and meteor bundle?

Having gone through and used demeteorizer. I wonder what are the main differences between setting up meteor vs demeteorizer and running it via node; on own server?

meteor only

  1. hot swappable code?
  2. problem in maintaining packages similar from production and dev
  3. same meteor versions running on prod and dev
  4. hardcoded environment settings (i.e. mongo)

demeteorizer

  1. platform independant as this auto bundles dependancies and uses pure nodejs
  2. organise and maintain mongodb how you like (backup scripts etc)

I have been using demeteorizer (packaging->upload->running forever), but wonder if there are any performance or issues in the long run.

I have seen packages such as "authentication" running okay locally but very slow on the test server (hangs on submit, indicating sync problems?)

thanks in advance.

ref: https://twitter.com/SachaGreif/status/424908644590030848


Source: (StackOverflow)