How it works. mongo-dev-server

I think I couldn’t understand the meteor project structure,
and I just want to have a look the code to run ‘mongod’ in dev_bundle,
but can’t find actual running code in github meteor project or project’s .meteor/local build code.

There’s only a single debug line in mongo-dev-server package, such as,
if (process.env.MONGO_URL === ‘no-mongo-server’) {
Meteor._debug(‘Note: Restart Meteor to start the MongoDB server.’);
}

What am I missing and where to see?
This will help my understanding for meteor structure.
Thanks-

The mongo runner is part of the meteor-tool package. The meteor-tool is the Meteor package that provides the meteor command, handles building the app and, in development, running it. dev_bundle is a folder inside the Meteor tool, and there is a symlink to it in your app at .meteor/local/dev_bundle.

The code for the runners are here. The meteor-tool would be installed on your computer in the ~/.meteor/packages/meteor-tool folder.

For some packages, their existence in an app affects how the meteor-tool handles the app. The three main ones are:

  • mongo-dev-server. If the app uses this package, the meteor-tool will run the mongo server
  • modules. Any apps or packages that use the modules package are bundled to run within a commonjs environment
  • hot-module-replacement. If an app uses this package, the meteor tool starts the HMR proxy, and makes some changes to the build process and the app’s environment.
2 Likes

Thank you zodern. This helps a lot for my understanding.
And hope to see a Gravity launching soon- :wink:

1 Like

One more thing~
Is there a document to understand meteor proces architecture or running explaination? even in rough-
I think this is a bit heavy for me to dig alone.
Thanks