# wetrade-backend

> Express backend that exposes REST api over the WeTrade chaincode.

Latest version **1.0.0** (published 2020-02-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install wetrade-backend
pnpm add wetrade-backend
yarn add wetrade-backend
bun add wetrade-backend
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-02-10 |
| First published | 2020-02-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.9.4 <9.0 |
| Dependencies | 24 |
| Unpacked size | 118.1 KB |
| Known vulnerabilities | 0 (+5 in 3 direct dependencies) |
| Install scripts | no |
| Maintainers | shgosavi |
| Keywords | fabric-client user, wetrade |

## Links

- npm: https://www.npmjs.com/package/wetrade-backend
- npm.io page: https://npm.io/package/wetrade-backend

## Dependencies (24)

- [chai](https://npm.io/package/chai.md) ^4.2.0
- [cors](https://npm.io/package/cors.md) ^2.8.3
- [faker](https://npm.io/package/faker.md) ^4.1.0
- [mocha](https://npm.io/package/mocha.md) ^6.1.4
- [sinon](https://npm.io/package/sinon.md) ^7.4.0
- [log4js](https://npm.io/package/log4js.md) ^0.6.38
- [should](https://npm.io/package/should.md) ^13.2.3
- [express](https://npm.io/package/express.md) ^4.15.2
- [fs-extra](https://npm.io/package/fs-extra.md) ^2.0.0
- [http-auth](https://npm.io/package/http-auth.md) 3.2.3
- [supertest](https://npm.io/package/supertest.md) ^4.0.2
- [sinon-chai](https://npm.io/package/sinon-chai.md) ^3.3.0
- [body-parser](https://npm.io/package/body-parser.md) ^1.17.1
- [express-jwt](https://npm.io/package/express-jwt.md) ^5.1.0
- [mocha-steps](https://npm.io/package/mocha-steps.md) ^1.3.0
- [prom-client](https://npm.io/package/prom-client.md) ^11.5.1
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1
- [fabric-client](https://npm.io/package/fabric-client.md) ^1.4.4
- [fabric-network](https://npm.io/package/fabric-network.md) ^1.4.4
- [chai-as-promised](https://npm.io/package/chai-as-promised.md) ^7.1.1
- [fabric-ca-client](https://npm.io/package/fabric-ca-client.md) ^1.4.4
- [express-prom-bundle](https://npm.io/package/express-prom-bundle.md) ^5.1.5
- [express-bearer-token](https://npm.io/package/express-bearer-token.md) ^2.1.0
- [@res-dlt-interop/fabric-interop-sdk](https://npm.io/package/@res-dlt-interop/fabric-interop-sdk.md) ^1.4.4

## Recent versions

- 1.0.0 (latest) — 2020-02-10

## README

# Wetrade backend

The actual application code here is a bit coupled with the deployment methods. It depends heavily on the `/deployments/app_config` folder and currently on the local deployment configuration.

# Setup Artifactory token for fabric-interop-sdk

1) Go to IBM artifactory (https://na.artifactory.swg-devops.com/artifactory/)
2) Click on your email id on top right
3) Generate/Copy the API key from profile, let's say it is - "ThisIsMyAPIKey"
4) Run this command on your system - 
	 curl --header 'X-JFrog-Art-Api: ThisIsMyAPIKey' https://na.artifactory.swg-devops.com/artifactory/api/npm/auth
5) The above command will return you auth token along with auth settings and your email id from artifactory.
6) Create a .npmrc file in the backend folder (from where you want to run npm install)
7) Add this line to your .npmrc file,
	 @res-dlt-interop:registry=https://na.artifactory.swg-devops.com/artifactory/api/npm/res-dlt-interop-npm-local/
8) Add the output of curl to that file.
9) Final .npmrc should look like this - 
   "@res-dlt-interop:registry=https://na.artifactory.swg-devops.com/artifactory/api/npm/res-dlt-interop-npm-local/
    _auth = <Auth-token>
    always-auth = true
    email = user@email.com"
10) Run npm install to check if artifactory connection is working before testing/deployment.


## Tests

Integration tests are now provided in `test/` folder. They can be run with `npm test` but they need the Fabric components to be running to be useful.

Local deployments now automatically run these tests. A separate container starting with `test-` is created and run. Look at it's logs to see how the tests perform.

---
_Source: https://npm.io/package/wetrade-backend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
