diff --git a/README.md b/README.md index a9e787b..a634093 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Start UI server yarn serve ``` -Using this command, all requests to `localhost:8080/api/` and `localhost:8080/holochain-api/` are forwarded to the holoport. This is really helpful for development/testing. +Using this command, all requests to `localhost:8080/api/` are forwarded to the holoport. This is really helpful for development/testing. If you want to run it against mocked data you will need to run it as below. diff --git a/mock-hpos-api/defaultResponse.js b/mock-hpos-api/defaultResponse.js index c5544e5..cf60b0e 100644 --- a/mock-hpos-api/defaultResponse.js +++ b/mock-hpos-api/defaultResponse.js @@ -639,27 +639,27 @@ let mockDefaultHappPreferences = { price_storage: (Math.random() * 10).toFixed(5).toString() } -// NB: both /api and /holochain-api calls are mocked here +// NB: both /api calls are mocked here const data = { get: { '/api/v1/config': userConfig, '/api/v1/status': holoNixpkgs, '/api/v2/apps/hosted': happs, - '/holochain-api/v1/get_happs': mockHapps, - '/holochain-api/v1/get_hosts': mockHosts, - '/holochain-api/v2/holoport/usage': usage, - '/holochain-api/v2/host/earnings': earnings, - '/holochain-api/v2/apps/core/version': coreAppVersion, - '/holochain-api/v2/host/invoices': mockPaidInvoicesData, - '/holochain-api/v2/host/redemptions': mockRedemptionHistoryData, - '/holochain-api/v2/host/kyc': mockKycData.kyc + '/api/v1/get_happs': mockHapps, + '/api/v1/get_hosts': mockHosts, + '/api/v2/holoport/usage': usage, + '/api/v2/host/earnings': earnings, + '/api/v2/apps/core/version': coreAppVersion, + '/api/v2/host/invoices': mockPaidInvoicesData, + '/api/v2/host/redemptions': mockRedemptionHistoryData, + '/api/v2/host/kyc': mockKycData.kyc }, put: { '/api/v1/config': (args) => args, '/api/v1/holoport/name': {} }, post: { - '/holochain-api/v1/apps/call_zome': (args) => { + '/api/v2/apps/call_zome': (args) => { switch (args.fnName) { case 'get_my_profile': return getMyProfile diff --git a/src/interfaces/HposInterface.ts b/src/interfaces/HposInterface.ts index d3526f3..5a4929b 100644 --- a/src/interfaces/HposInterface.ts +++ b/src/interfaces/HposInterface.ts @@ -421,7 +421,7 @@ export function useHposInterface(): HposInterface { // On 401 redirect to login and unset authToken because the reason for 401 might be it's expired try { return await hposCall({ - pathPrefix: '/holochain-api/v2', + pathPrefix: '/api/v2', ...args }) } catch (err) { diff --git a/vite.config.ts b/vite.config.ts index 8bcbfaa..5d21e86 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -51,10 +51,6 @@ export default defineConfig(({ mode }) => { port: 8080, proxy: { '^/api/*': { - target: env.VITE_HOLOPORT_URL, - changeOrigin: true - }, - '^/holochain-api/*': { target: env.VITE_HOLOPORT_URL, changeOrigin: true }