places-api is an implementation of the OpenStreetMap API written in node.js as middleware for the express.js web application framework.
The places-api acts as middleware for express.js, and cannot run on its own. The places-website is designed to be a container for the places-api.
The following steps are designed to be copied and pasted directly into your CLI.
git clone https://github.com/nationalparkservice/places-website.git
cd places-website
npm install
cp example.config.json config.json
`which subl || which vim` config.json
npm start
This guide will detail the steps to installing the PostGIS database on an ubuntu machine.
There is a guide for windows as well.
To install on Mac OSX, see ./node_modules/places-api/scripts/create_osm_db_mac.sh
.
cd ./node_modules/places-api/
bash ./scripts/install_postgres_9.4.sh
bash ./scripts/create_osm_db.sh
The default snapshot database name (poi_pgs) and owner (postgres) are configurable in config.json, however they are hardcoded into two functions (nps_dblink_pgs and nps_dblink_pgs_text) in sql_scripts/api/func_nps_tools.sql. If you choose to stray from the defaults, this file will need to be edited accordingly.
The iD editor that is include will not work be default, as it needs to be built. You will need to remove the places-editor directory from the /node_modules directory and clone it in instead. This will ensure that you have all the dev dependencies.
After it's cloned, edit the js/id/id.js file's npmap variable to reflect the path to your server/port.
Once you do that, run an npm install
on it and the make
command.
You can then navigate to http://SERVER:PORT/dist and start editing the map!