1.0.4 • Published 7 years ago
omsfeed v1.0.4
omsfeed
Server-side of pet project for private needs.
Express app to retrieve precious metals (au, ag, pt, pd) daily quotes (from local bank), store them in MongoDB and provide API on top.
Demo
Building blocks, Credits
API
Endpoints:
/quotes/<asset>?date=[YYYY-MM-DD]- single date quotes,asset(au,ag,pt,pd) is optional/quotes/<asset>?startDate=[YYYY-MM-DD]- date range quotes,assetandendDateare optional- TODO: normalized buy/sell (spread is increased on non-working days and hours).
Examples:
/quotes/?date=2018-08-01all asset quotes for Aug, 1/quotes/au?date=2018-08-01gold quotes for Aug, 1/quotes/?startDate=2018-08-01&endDate=2018-08-10gold quotes from Aug, 1 to Aug, 10/quotes/?startDate=2018-12-01all asset quotes for Dec, 1 till now
Tools
Available as npm scripts:
- Fetch quotes from remote feed to JSON (
npm run @tools/fetch) - Load quotes from JSON to MongoDB (
npm run @tools/db-import)
Configuration
Default MongoDB connection options that could be overridden with environment variables:
- connection string:
mongodb://localhost:27017(envMONGO_OMS_URI) - database name:
oms(envMONGO_OMS_DB) - collection name:
asset-quotes(envMONGO_OMS_COLLECTION) - logs collection name:
request-logs(envMONGO_OMS_COLLECTION_LOGS)
Running locally
git clone https://github.com/pmstss/omsfeed
cd omsfeed
npm install
npm run build
npm run startor
npm install omsfeed
node node_modules/omsfeed/dist/server.jsContribution
Feel free to contribute by opening issues with any questions, ideas or feature requests.