justnom / bat-ratios

a server to cache and serve up exchange rates between currencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bat-ratios

Server for ratios between fiats and alts

setup

git pull git@github.com:brave-intl/bat-ratios.git
yarn install

start

yarn start

test

yarn test

development

before anything else you must do the following steps

yarn run docker-build # build the containers
yarn run docker-up-dbs # bring the dbs up
yarn run docker-migrate-dbs # migrate the dbs
yarn run docker-fill-dbs # fill the dbs with data
# optionally
yarn run docker-up # brings server up
yarn run dev

to access the documentation visit /v1/documentation/

Postgres

After running

yarn run docker-migrate-up

login to the db with

psql postgres://ratios:password@localhost:5010/ratios

curling

curl -X GET \
  -H "Authorization: Bearer $(kubectl --context bsg-sandbox \
    -n ratios-staging \
    get secrets/env -o json | \
    jq -r '.data.TOKEN_LIST' | \
    base64 -d | \
    jq -j -R 'split(",")|.[0]'
  )" \
  https://ratios.bsg.bravesoftware.com/v1/history/single/fiat/EUR/2020-11-01

About

a server to cache and serve up exchange rates between currencies


Languages

Language:JavaScript 98.3%Language:PLpgSQL 0.7%Language:Shell 0.6%Language:Dockerfile 0.4%