If you're setting up the registry locally, perhaps to fix a bug or contribute a pull request, here's how to set up your mongo db instance and get it populated with some sample InterMine instances.
- A recent version of node and npm, ideally installed via nvm
- MongoDB
git clone https://github.com/intermine/intermine-registry.git
cd intermine-registry
Once you have node and mongo installed, you'll need to provide the registry with information about where to find the mongo database. One way to do this is to type the following into a terminal:
export MONGODB_URL=mongodb://localhost:27017/registry This assumes you have a Mongo server up and running on port 27017 (this is the default port), and it will save all entries to the registry database.
In a console, run this from the registry root folder:
npm install # this installs the dependencies for the registry
npm start # this starts the serverInside your registry project folder, run
node createUser.jsThis will prompt you to set a username and password, and then create the entries in the mongo database. The password is hashed.
Inside initRegistry.js change the username and password to your own
const username = 'your username';
const password = 'your password';If you do not edit the username and password to your own, you will end up with an authentication error.
Great job- nearly there now! In order to have some InterMines present in the registry, rather than just a blank page, we'll need to run the initRegistry.js script.
First we need to set a couple of settings.
Open up initRegistry.js in a text editor. Add your username and password (and if necessary, change the 'host' value, although the default should work if you haven't changed it). This is currently found around line 40.
Once those details are set, run
node initRegistry.jsThis will add InterMine entries into the Mongo database. If you visit http://localhost:3000 you should see the populated entries!