Skip to content

Commit

Permalink
update urls holochain-api => api
Browse files Browse the repository at this point in the history
  • Loading branch information
peeech committed Jul 1, 2024
1 parent 85e2ebf commit 9b8a509
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
20 changes: 10 additions & 10 deletions mock-hpos-api/defaultResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/HposInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 0 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9b8a509

Please sign in to comment.