Skip to content

Commit

Permalink
feat: migrate to web map client mock server
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Nov 16, 2021
1 parent 73ccf1c commit af9465a
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 13 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,9 @@ npm run cy

## The API

We got another team working on the API endpoint, so the API spec is evolving. This is the current API specification:
Now we are going to combine the API of wallet API with the web map client API, so we deprecated the API and mock server under `doc` folder. Instead, you need to run the mock server from `treetracker-web-map-client` repo. Please download that repo and run the mock server: `npm run mock-server`.

[API spec](/doc/wallet-web-app.yaml)

To check the doc in a convenient way, please import it to some API tools like: http://editor.swagger.io/ or Postman.

To import the API doc to Postman or Swagger (both work the same), simply just click on the 'File' tab in the menubar and look for the 'Import' option. Find the API .yaml file in your local repository inside the doc directory and click 'Open'.

### Using our mock API server

Refer to [here](https://github.com/Greenstand/treetracker-web-map-client/blob/web-map-site/README.md#using-our-mock-api-server)
The details is here: https://github.com/Greenstand/treetracker-web-map-client#the-api

### Config

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function LandingPage() {

function handleClick() {
log.debug('load finished');
history.push('/wallets/stephanie');
history.push('/wallets/180Earth');
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/MapDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ function MapDrawer(props) {

const getWalletData = async () => {
let response = await axios.request({
url: `${process.env.REACT_APP_API_WALLET}/wallets/SustainablyRun`,
url: `${process.env.REACT_APP_API_WALLET}/wallets/180Earth`,
});
setWallet(response.data);
response = await axios.request({
url: `${process.env.REACT_APP_API_WALLET}/wallets/SustainablyRun/tokens`,
url: `${process.env.REACT_APP_API_WALLET}/tokens/query/wallet=180Earth&withPlanter=true&withCapture=true`,
});
setTokens(response.data.tokens);
log.warn('loaded wallet:', wallet);
Expand Down
42 changes: 42 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4706,6 +4706,13 @@
"resolved" "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz"
"version" "2.2.0"

"bindings@^1.5.0":
"integrity" "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ=="
"resolved" "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz"
"version" "1.5.0"
dependencies:
"file-uri-to-path" "1.0.0"

"blob-util@^2.0.2":
"integrity" "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ=="
"resolved" "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz"
Expand Down Expand Up @@ -8635,6 +8642,29 @@
"resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
"version" "1.0.0"

"fsevents@^1.2.7":
"integrity" "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw=="
"resolved" "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz"
"version" "1.2.13"
dependencies:
"bindings" "^1.5.0"
"nan" "^2.12.1"

"fsevents@^2.1.2", "[email protected]":
"integrity" "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA=="
"resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz"
"version" "2.1.2"

"fsevents@^2.1.3":
"integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="
"resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
"version" "2.3.2"

"fsevents@~2.3.2":
"integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="
"resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
"version" "2.3.2"

"function-bind@^1.1.1":
"integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
Expand Down Expand Up @@ -12250,6 +12280,11 @@
"resolved" "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz"
"version" "0.0.8"

"nan@^2.12.1":
"integrity" "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ=="
"resolved" "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz"
"version" "2.15.0"

"nanoid@^3.1.23":
"integrity" "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q=="
"resolved" "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz"
Expand Down Expand Up @@ -17230,6 +17265,13 @@
dependencies:
"makeerror" "1.0.x"

"watchpack-chokidar2@^2.0.1":
"integrity" "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww=="
"resolved" "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz"
"version" "2.0.1"
dependencies:
"chokidar" "^2.1.8"

"watchpack@^1.6.0", "watchpack@^1.7.4":
"integrity" "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ=="
"resolved" "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz"
Expand Down

0 comments on commit af9465a

Please sign in to comment.