Implements a REST / Webhook API Server on top of https://github.com/stoqey/ib
We use this app as part of our microservice ecosystem and it is OSS so you don't need to write it again. No questions will be answered, no support will be given, no feature-request will be accepted. Use it - or fork it and roll your own :)
$ yarn global add @openapitools/openapi-generator-cli
$ yarn install
$ yarn build
$ yarn start
$ yarn release
Create an .env file on root folder with:
- TWS_USERID (your TWS user id)
- TWS_PASSWORD (your TWS password)#
- TRADING_MODE ('paper' or 'live')
Run:
$ docker-compose up --build
$ yarn add @waytrade/ib-api-service
and generate your client code, like:
$ openapi-generator-cli generate -i ./node_modules/@waytrade/ib-api-service/openapi.json -g typescript-axios -o ./src/apis/ib-api-service
ib-api-service:
image: waytrade/ib-api-service
restart: always
environment:
SERVER_PORT: 3002
TWS_USERID: ${TWS_USERID}
TWS_PASSWORD: ${TWS_PASSWORD}
TRADING_MODE: ${TRADING_MODE:-live}
NODE_ENV: production
ports:
- 3002:3002