0

I am trying to build an application for a local private network (with no access to the web) using meteor. From my research, I can't seem to find a way to take meteor 100% 'offline' meaning, no dependencies to web services to build / run.

I've looked at the following links - How can Meteor apps work offline? and here - https://groups.google.com/forum/#!topic/meteor-talk/tGto0cCsvXA yet neither threads give a clear cut answer on if it's possible and how to go about formulating an approach.

I am hoping someone could provide guidance on how I would go about removing the meteor framework dependencies for online services. If this won't be possible, other suggestions for frameworks that play well for local private network apps would be most appreciated.

Community
  • 1
  • 1
Ryan
  • 3
  • 1

1 Answers1

2

If I get you right, you wish to build a webapp that is to be deployed on a local network.

If that is indeed the case, then the answer is yes.

An example setup would be:

  1. a server computer with linux (ex: Ubuntu server)
  2. node installed on it (0.10.29 is necesarry for a 0.8.3 meteor app - see: https://askubuntu.com/questions/49390/how-do-i-install-the-latest-version-of-node-js)
  3. mongodb installed and running as a service
  4. then on your dev machine run

    meteor bundle --directory /your/independent/app
    
  5. Copy the app folder to the target machine
  6. Though you will find more information in the bundled README (see below) I use the following bash script to start my app

    rm -rf programs/server/node_modules/fibers
    npm install ~/.meteor/tools/latest/lib/node_modules/fibers/
    # npm install fibers@1.0.1
    export MONGO_URL='mongodb://localhost/survey'
    export PORT=3000
    export ROOT_URL='http://127.0.0.1'
    
    ~/bin/node main.js
    

And that's about it. With these steps you can deploy an app created by meteor on any machine. The only dependencies being node (specific versions) and mongodb.

README (generated by meteor bundle)

This is a Meteor application bundle. It has only one dependency:
Node.js 0.10.29 or newer, plus the 'fibers' and 'bcrypt' modules.
To run the application:

  $ rm -r programs/server/node_modules/fibers
  $ rm -r programs/server/node_modules/bcrypt
  $ npm install fibers@1.0.1
  $ npm install bcrypt@0.7.7
  $ export MONGO_URL='mongodb://user:password@host:port/databasename'
  $ export ROOT_URL='http://example.com'
  $ export MAIL_URL='smtp://user:password@mailhost:port/'
  $ node main.js

Use the PORT environment variable to set the port where the
application will listen. The default is 80, but that will require
root on most systems.

Find out more about Meteor at meteor.com.
Community
  • 1
  • 1
Matyas
  • 13,473
  • 3
  • 60
  • 73