jobar / FeatureService

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ODE Feature Service Build Status

REST API for ODE features data

Adapted from Restbase

Installation

Make sure you have node 6+ installed

Debian / ubuntu

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_6.x | bash - && apt-get install -y nodejs

From the FeatureService directory, install node dependencies:

npm install

Set up dev & test databases with docker:

docker pull mdillon/postgis
docker run --name devdb -p 127.0.0.1:5432:5432 -d mdillon/postgis
docker run --name testdb -e POSTGRES_USER=test -p 127.0.0.1:5433:5432 -d mdillon/postgis

Use knex to set up dev database

alias knex=node_modules/knex/bin/cli.js
knex migrate:latest
knex seed:run

Start FeatureService:

node server

The defaults without a config file should work. To customize FeatureService's behavior, copy the example config to its default location:

cp config.example.yaml config.yaml

You can also pass in the path to another file with the -c commandline option to server.js.

To use authentication features, you can use the login/password default user in tests, or create a new htpasswd file and reference it in the yaml config file for production deployments.

Testing

To run all the tests from a clean slate:

npm test

Coverage

To check the test coverage, use npm, then browse the report:

npm run-script coverage

The coverage report can now be found in <project>/coverage/lcov-report/index.html.

About

License:GNU General Public License v3.0


Languages

Language:JavaScript 99.7%Language:Shell 0.3%