Meatier Apps With Meteor

Meteor is a framework that allows you to write web applications using only javascript. All the work is done on the client-side. Meteor embraces new principles of web design: data on the wire, one language is enough, and simplicity makes for productivity.

Simplicity is something I value as well, and while setting up meteor on my linux machine was not a three-step process as outlined in their examples, it only took a little tinkering to figure out the problem. First, a look at the three meteor setup steps:

Install

$ curl https://install.meteor.com | /bin/sh

Create a sample application

$ meteor create testapp

Run the sample application

$ cd testapp
$ meteor

This is where the meteor server is supposed to start, connecting to your mongo installation, and serving your application on port 3000:

$ meteor
[[[[[ /path/to/testapp ]]]]]

=> Meteor server running on: http://localhost:3000/

Instead, my terminal became quite upset about it:

[[[[[ /path/to/testapp ]]]]]

Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start mongod

Whups! Everything seems normal in my mongo installation, but after a lot of searching I finally found the problem on stackoverflow. From among the answers I found this solution:

I’m also getting this error on Ubuntu. As mentioned, it’s caused by mongo and mongod from ~/.meteor/tools/latest/mongodb/bin being compiled with an older version of glib. You can replace the version of mongo bundled by meteor with the version installed in your system:

cd ~/.meteor/tools/latest/mongodb/bin/
mv mongo mongo-backup
mv mongod mongod-backup
ln -s /usr/bin/mongo
ln -s /usr/bin/mongod

Brilliant! Following these instructions, I was finally able to start meteor.

Getting down to business

Now to test out some of the awesome functionality of this framework. I followed an example and created a todo list:

$ meteor create --example todos
$ cd todos
$ meteor deploy totally-fake-url.meteor.com
Deploying to totally-fake-url.meteor.com.  Bundling...
Uploading...
Now serving at totally-fake-url.meteor.com

Playing around with creating new todos and lists, it is clear that data is being added and changed instantly and persistently.

A Meteor application is a mix of JavaScript that runs inside a client web browser, JavaScript that runs on the Meteor server inside a Node.js container, and all the supporting HTML fragments, CSS rules, and static assets.

I am really looking forward to diving further into the docs to learn more about this incredible framework. AWESOME