Skip to content

GeoGateway/geogateway-portal

Repository files navigation

This is the GeoGateway project.  To install, you need to first install the NPM package manager, Node.js, Git, and MongoDB. MongoDB's default data directory is /data/db, so either make this directory and give it the correct permissions or else change the data directory.  You may already have Git installed. Just type "git" at the command line to see.

INSTALLATION
Run the following commands at the shell prompt:

* cd $INSTALL_PATH
   - You don't need this environment variable set, but we will use it for clarity.

* git clone https://github.com/GeoGateway/geogateway-portal.git

* cd $INSTALL_PATH/geogateway

* npm install
   - This will install the packages listed in packages.json.
   - Will need to put npm in your PATH
   - ex: export PATH=~/node-v0.10.36-linux-x64/bin/:$PATH

* cd $INSTALL_PATH/geogateway/html

* bower install  

* mkdir -p $INSTALL_PATH/geogateway/html/userUploads  (make sure this directory exists)

RUNNING THE SERVICE
Run the following commands

* mongod
   - This starts MongoDB and can be run from anywhere.
   - You need mongod in your path
   - ex: export PATH=$HOME/mongodb-linux-x86_64-2.6.7/bin/:$PATH

* cd $INSTALL_PATH/geogateway

* cp sample-config.js config.js
   - Edit this file for your local installation.

* node GeoGatewayServer.js

USING THE INTERFACE
Point your browser to http://localhost:3000/main.html

UPDATING THIRD PARTY DEPENDENCIES
To keep libraries up to date, periodically run the following:

* npm update (from $INSTALL_PATH/geogateway)

* bower update (from $INSTALL_PATH/geogateway/html)

ENABLE HTTPS  
```
const https=require('https');
const certoptions = {
  key: fs.readFileSync("/cert/privkey.pem"),
  cert: fs.readFileSync("/cert/fullchain.pem")
};

https.createServer(certoptions, app).listen(app.get('port'),function() {
	 console.log('Listening...');
})
```