Unverified Commit 2e6093c4 authored by Dan Jones's avatar Dan Jones
Browse files

fix: pass config to adapter constructor

- Update README with install instructions for private repo
- Move location of soar-config.json import from adapter to
  the host of the adapter.
parent 8f44e4b3
......@@ -12,14 +12,26 @@ Implements:
## Install
**TODO** These should work once the repository is made public
### Yarn
#### Once public
```yarn
yarn add git+https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript.git
```
#### For now
```yarn
# You may need to tell it how to use your ssh key
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa
export GIT_SSH_COMMAND="/usr/bin/ssh -i /home/danjon/.ssh/id_rsa -o IdentitiesOnly=yes"
# Then you can install the private repo via ssh
yarn add ssh://git@git.noc.ac.uk:communications-backbone-system/backbone-adapter-javascript.git#1-import-prototype-adapter-code-from-example-web-client
```
### NPM
```npm
......
import Validator from 'swagger-model-validator';
import axios from 'axios';
import * as soarConfig from '~/soar-config.json';
/**
* Handle authentication and send/receive with the backbone
*/
export class Adapter {
constructor(protocol) {
constructor(protocol, soarConfig) {
this.apiRoot = soarConfig.api;
this.protocol = protocol;
this.axios = axios;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment