This repository contains the nodejs server for the USA-NPN geo services. This services main purpose is to complement NPN's geoserver by delivering geospatial statistics and do various raster geometry slicing.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
To run the pop server the following need to be installed:
All additional dependancies are managed through npm, the node package manager which is included with node.
After cloning the project you will need to take the following steps.
cd into the main directory and install all dependancies through npm.
cd npn-geo-services
npm install
The command installs all dependencies listed in the package.json file into a folder called node_modules.
Configuration is managed through environment variables. The following need to be set:
SERVICES_HOST=host_where_node_is_running
PORT=port_for_services_to_listen_on
PGPORT=postgres_port
PGUSER=postgres_user
PGPASSWORD=postgres_password
PGDATABASE=postgres_database
PGHOST=postgres_host
GEOSERVER_HOST=geoserver_host
GEOSERVER_USER=geoserver_wps_user
GEOSERVER_PASSWORD=geoserver_wps_user_password
GEOSERVER_PORT=geoserver_port
Currently this project is pure js, no transpiling is required.
To run tests:
npm test
which runs (swagger project test
)
To start server:
npm start
To open the swagger editor (on the fly swagger.yaml feedback in the browser):
swagger project edit
This server is deployed with teamcity and started using ubuntu upstart which autostarts the server on boot and provides the following commands.
sudo service npn-geo-service stop
sudo service npn-geo-service start
sudo service npn-geo-service restart
sudo service npn-geo-service status
The service is located in /etc/init/npn-geo-service.conf
See also the list of contributors who participated in this project.