Installing PostgreSQL
- Add PostgreSQL Apt Repository
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
- Install PostgreSQL
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
Importing third party libraries:
npm install
Initializing the database
bin/gulp init-db
bin/gulp scrape
node index.js
npm test
Getting data for one key ( the main nasdaq index ) for the last 30 min ( default )
http://localhost:3000/v1/datapoints?key=nasdaq
Getting data for one key ( the main nasdaq index ) for a specific time range
http://localhost:3000/v1/datapoints?key=nasdaq&time_start=1472982360&time_end=1472988360
Getting data for multiple keys
http://localhost:3000/v1/datapoints for the last 30 min ( default )